library(readr)
data <- read_csv("D:/UMP/Sem 5/EDA/Lab Report/Lab Report 3.csv")
##
## -- Column specification --------------------------------------------------------
## cols(
## Concentration = col_double(),
## Days = col_double(),
## strength = col_double()
## )
View(data)
Treatment = as.factor(data$Concentration)
block = as.factor(data$Days)
results = aov(strength~block+Treatment,data)
summary(results)
## Df Sum Sq Mean Sq F value Pr(>F)
## block 6 1114.3 185.71 8.814 0.00358 **
## Treatment 6 1317.4 219.57 10.420 0.00205 **
## Residuals 8 168.6 21.07
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
H0: There is no treatments effect
H1: there is treatment effect
p-value=0.0021
Since p-value=0.0021<alpha=0.05, we reject H0.
library(DescTools)
## Warning: package 'DescTools' was built under R version 4.0.5
PostHocTest(results, method = "lsd")
##
## Posthoc multiple comparisons of means : Fisher LSD
## 95% family-wise confidence level
##
## $block
## diff lwr.ci upr.ci pval
## 2-1 7.000000e+00 -1.642939 15.6429389 0.09876 .
## 3-1 -5.000000e+00 -13.642939 3.6429389 0.21892
## 4-1 1.800000e+01 9.357061 26.6429389 0.00135 **
## 5-1 -4.263256e-14 -8.642939 8.6429389 1.00000
## 6-1 -3.000000e+00 -11.642939 5.6429389 0.44658
## 7-1 -1.000000e+00 -9.642939 7.6429389 0.79637
## 3-2 -1.200000e+01 -20.642939 -3.3570611 0.01258 *
## 4-2 1.100000e+01 2.357061 19.6429389 0.01886 *
## 5-2 -7.000000e+00 -15.642939 1.6429389 0.09876 .
## 6-2 -1.000000e+01 -18.642939 -1.3570611 0.02845 *
## 7-2 -8.000000e+00 -16.642939 0.6429389 0.06534 .
## 4-3 2.300000e+01 14.357061 31.6429389 0.00028 ***
## 5-3 5.000000e+00 -3.642939 13.6429389 0.21892
## 6-3 2.000000e+00 -6.642939 10.6429389 0.60811
## 7-3 4.000000e+00 -4.642939 12.6429389 0.31701
## 5-4 -1.800000e+01 -26.642939 -9.3570611 0.00135 **
## 6-4 -2.100000e+01 -29.642939 -12.3570611 0.00051 ***
## 7-4 -1.900000e+01 -27.642939 -10.3570611 0.00097 ***
## 6-5 -3.000000e+00 -11.642939 5.6429389 0.44658
## 7-5 -1.000000e+00 -9.642939 7.6429389 0.79637
## 7-6 2.000000e+00 -6.642939 10.6429389 0.60811
##
## $Treatment
## diff lwr.ci upr.ci pval
## 4-2 3.000000 -5.64293889 11.6429389 0.44658
## 6-2 11.666667 3.02372778 20.3096056 0.01439 *
## 8-2 18.000000 9.35706111 26.6429389 0.00135 **
## 10-2 20.333333 11.69039444 28.9762722 0.00063 ***
## 12-2 5.666667 -2.97627222 14.3096056 0.16901
## 14-2 9.000000 0.35706111 17.6429389 0.04309 *
## 6-4 8.666667 0.02372778 17.3096056 0.04951 *
## 8-4 15.000000 6.35706111 23.6429389 0.00394 **
## 10-4 17.333333 8.69039444 25.9762722 0.00170 **
## 12-4 2.666667 -5.97627222 11.3096056 0.49700
## 14-4 6.000000 -2.64293889 14.6429389 0.14808
## 8-6 6.333333 -2.30960556 14.9762722 0.12954
## 10-6 8.666667 0.02372778 17.3096056 0.04951 *
## 12-6 -6.000000 -14.64293889 2.6429389 0.14808
## 14-6 -2.666667 -11.30960556 5.9762722 0.49700
## 10-8 2.333333 -6.30960556 10.9762722 0.55091
## 12-8 -12.333333 -20.97627222 -3.6903944 0.01101 *
## 14-8 -9.000000 -17.64293889 -0.3570611 0.04309 *
## 12-10 -14.666667 -23.30960556 -6.0237278 0.00446 **
## 14-10 -11.333333 -19.97627222 -2.6903944 0.01646 *
## 14-12 3.333333 -5.30960556 11.9762722 0.39976
##
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Based on the output, the significants are 8-2, 10-2, 8-4, 10-4, 12-10 because it has p-value < alpha=0.05.
The most significant comparison is 10-2 because it has the smallest p-value= 0.0006 and the largest difference.
knitr::include_graphics("D:/UMP/Sem 5/EDA/Lab Report/Marking Files.png")
knitr::include_graphics("D:/UMP/Sem 5/EDA/Lab Report/Rubrics.PNG")