In: Statistics and Probability
You wish to compare the short-term effects of three new sleep-aid drugs. You try all three in a sample of eight subjects, with 5 day between each test. Data 18E give the number of hours slept during the night under each drug. a) give Ho. b) Conduct the F test (a=.05) c) Apply Turkey's HSD test. d) state your conclusion. Data 18E Subject: 1,2,3,4,5,6 Drug A: 6,5,6,7,8,4,5,6 Drug B: 5,6,6,7,6,5,7,6 Drug C: 8,7,9,6,8,8,8,7
Using R
A <- c(6,5,6,7,8,4,5,6)
B <- c(5,6,6,7,6,5,7,6)
C <- c(8,7,9,6,8,8,8,7)
hours <- c(A,B,C)
class <- c(rep("A", 8), rep("B", 8), rep("C", 8))
dat<-data.frame(hours , class)
summary(aov(hours~class,data = dat))
TukeyHSD(aov(dat$hours~dat$class))
           Df Sum Sq Mean Sq F value  Pr(>F)   
class        2  15.25   7.625   7.717 0.00307 **
Residuals   21  20.75   0.988                   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> TukeyHSD(aov(dat$hours~dat$class))
  Tukey multiple comparisons of means
    95% family-wise confidence level
Fit: aov(formula = dat$hours ~ dat$class)
$`dat$class`
     diff       lwr      upr     p adj
B-A 0.125 -1.127761 1.377761 0.9657885
C-A 1.750  0.497239 3.002761 0.0055171
C-B 1.625  0.372239 2.877761 0.0098149
b)
F = 7.717
p-value = 0.00307
p-value < alpha(0.05)
hence the difference is significant
c)
there is difference in A and C
as well as B and C