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?
(a) Graph the data. Why did you choose the graph that you did and what does it tell you?
(b) Create an ANOVA table for the data using your calculator (to prepare for exams). Show your work. You may use R to check your answers.
(c) Evaluate the ANOVA assumptions graphically. Was ANOVA appropriate here?
(d) Based on the ANOVA table, make a conclusion in the context of the problem.
(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 complete and show all work and R codes for part E only. Thank you!
Solution :
Given that:
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
(a) Graph the data. Why did you choose the graph that you did and what does it tell you?
We will graph the data using boxplot to compare the amount of REM sleep for three different treatments.
It tells that the mean amount of REM sleep is highest for treatment 1 and lowest for treatment 3.
R code used to generate the plot.
rem = c(63, 54, 69, 50, 72,45, 60, 40, 56,31, 40, 45, 25, 23,28)
treatments = c(1,1,1,1,1,2,2,2,2,3,3,3,3,3,3)
treatments = as.factor(treatments)
boxplot(rem~treatments,xlab="Treatments",ylab="REM")
(b) Create an ANOVA table for the data using the formulas provided in class. Show your work. You may use R to check your answers.
Anova Table is,
Grand mean = 46.73
Total sum of squares, SST =
Total sum of squares, SST = 3454.934
Error Sum of squares, SSE =
Error Sum of squares, SSE = 997.95
Treatment sum of squares, SSTR = SST - SSE = 3454.933 - 997.95 = 2456.983
Degree of freedom for SSTR is 2 ( Number of treatments - 1)
Degree of freedom for SSE is 12 ( Number of observations - Number of treatments)
MSTR = 2456.983/2 = 1228.492
MSE = 997.95/12 = 83.1625
F= 1228.492/83.1625 = 14.77219
p-value for F = 14.77219 at df = 2,12 is 0.000581
The output of R also shows the same result.
aov.out = aov(rem~treatments)
aov.out
Call:
aov(formula = rem ~ treatments)
Terms:
treatments Residuals
Sum of Squares 2456.983 997.950
Deg. of Freedom 2 12
Residual standard error: 9.119348
Estimated effects may be unbalanced
summary(aov.out)
Df Sum Sq Mean Sq F value Pr(>F)
treatments 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
(c) Evaluate the ANOVA assumptions graphically. Was ANOVA appropriate here?
The normality assumptions is checked by the code qqnorm(rem,pch=16)
As, the graph is linear, the normality condition is satisfied.
The residual plot is created by the command plot(aov.out). As there is no specific pattern , constant variance condition is also satisfied.
(d) Based on the ANOVA table, make a conclusion in the context of the problem.
As the p-value is less than 0.05, we reject the null hypothesis and conclude that the effect of treatments on amount of REM sleep is significant.
(e) From the givend data
Level N Mean StDev
Treatment 1 5 61.600 9.450
Treatment 2 4 50.250 9.323
Treatment 3 6 32.000 8.718
The pairwise comparisons of means using the Tukey method as
Please give me a thumbs-up if this helps you out. Thank you!