In: Statistics and Probability
A study explored the effect of ethanol on sleep time. Fifteen rats were randomized to one of three treatments. Treatment 1 was water (control). Treatment 2 was 1g of ethanol per kg of body weight, and Treatment 3 was 2g/kg. The amount of REM sleep (in minutes) in a 24hr period was recorded: Treatment 1: 63, 54, 69, 50, 72 Treatment 2: 45, 60, 40, 56 Treatment 3: 31, 40, 45, 25, 23, 28 Are these data strong evidence REM sleep time differs across the three treatment populations?
(e) Use R to create 95% CIs for all pairwise comparisons of means using the Tukey-Kramer method. Summarize your results using letter codes. What do you conclude?
Please solve letter e, if there is any R code involved include it
Solution-:
use tumey kramer on resulted aov function in R
Rcode:
df1 =read.table(header = TRUE, text ="
Treatment REM
1 63
1 54
1 69
1 50
1 72
2 45
2 60
2 40
2 56
3 31
3 40
3 45
3 25
3 23
3 28
"
)
df1
df1$Treatment <- ordered(df1$Treatment ,
levels = c("1", "2", "3"))
summary(df1)
res.aov <- aov(REM ~ Treatment , data = df1)
summary(res.aov)
TukeyHSD(res.aov)
Output:
summary(res.aov)
Df Sum Sq Mean Sq F value Pr(>F)
Treatment 2 2457 1228.5 14.77 0.000581 ***
Residuals 12 998 83.2
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> TukeyHSD(res.aov)
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = REM ~ Treatment, data = df1)
$Treatment
diff lwr upr p adj
2-1 -11.35 -27.67051 4.970507 0.1939650
3-1 -29.60 -44.33205 -14.867952 0.0004632
3-2 -18.25 -33.95442 -2.545584 0.0231619
Intrepretation:
Ho:
Ha:Atleast one the treatment
F=14.77
p=0.000581
From ANOVA table we conclude that the atleast one of the tretaments are different.
Solution-e:
$Treatment
diff lwr upr p adj
2-1 -11.35 -27.67051 4.970507 0.1939650
3-1 -29.60 -44.33205 -14.867952 0.0004632
3-2 -18.25 -33.95442 -2.545584 0.0231619
Treatment 3 and Treatment 1 are different
p=0.0004632,as p<0.05
Treatment 3 and Treatment 2 are different asp=0.0231619 as p<0.05