In: Statistics and Probability
Diagnosis Category
affective disorders | cognitive disorder | drug-related conditions |
7 | 12 | 8 |
6 | 8 | 10 |
5 | 9 | 12 |
6 | 11 | 10 |
Conduct Tukey's HSD post hoc test to determine where there is a difference in the three groups.
5% level of significance
Conduct one way ANOVA and then post Hoc test Tukey kramer
in R studio:
Rcode:
df1 =read.table(header = TRUE, text ="
category pats
1 7
1 6
1 5
1 6
2 12
2 8
2 9
2 11
3 8
3 10
3 12
3 10
"
)
df1
df1$category <- ordered(df1$category ,
levels = c("1", "2", "3"))
summary(df1)
res.aov <- aov(pats ~ category , data = df1)
summary(res.aov)
TukeyHSD(res.aov)
Output:
res.aov <- aov(pats ~ category , data = df1)
> summary(res.aov)
Df Sum Sq Mean Sq F value Pr(>F)
category 2 42.67 21.333 9.6 0.00586 **
Residuals 9 20.00 2.222
---
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 = pats ~ category, data = df1)
$category
diff lwr upr p adj
2-1 4 1.056968 6.943032 0.0106731
3-1 4 1.056968 6.943032 0.0106731
3-2 0 -2.943032 2.943032 1.0000000
Intrepretation:
ANOVA one way
Ho:
Ha:atleast one of the
F=9.6
p=0.00586
p<0.05
Reject Ho
Accept Ha
Conclusion:
There is suffcient statistical evdidence at 5% level of
significance to conclude that atleast one of the group means are
different.
Conduct Tukey kramer to know which group means are different
$category
diff lwr upr p adj
2-1 4 1.056968 6.943032 0.0106731
3-1 4 1.056968 6.943032 0.0106731
3-2 0 -2.943032 2.943032 1.0000000
P>0.05 means that group means are not different
p<0.05,means that group means are different
For
2-1 p=0.0106731,p<0.05
affective disorders | cognitive disorder |
are different
3-1 ,p= 0.0106731,p<0.05
drug-related conditions and affective disorders group means are different