In: Statistics and Probability
1319 school children were evaluated at age 12 and at age 14 for the prevalence of severe colds. There were 356 children who had severe colds at age 12, and 468 who had severe colds at age 14. There were 212 children who had severe colds at both ages. Do school children tend to have more severe colds when they are younger?
Result:
1319 school children were evaluated at age 12 and at age 14 for the prevalence of severe colds. There were 356 children who had severe colds at age 12, and 468 who had severe colds at age 14. There were 212 children who had severe colds at both ages. Do school children tend to have more severe colds when they are younger?
Build a two-way table displaying the information above.
Age 14 |
||||
cold |
No cold |
Total |
||
Age 12 |
cold |
212 |
144 |
356 |
No cold |
256 |
707 |
963 |
|
Total |
468 |
851 |
1319 |
Run McNemar’s test using the binomial distribution to see if there is sufficient evidence to conclude that school children are more likely to have severe colds at a younger age. Make sure to include all of the steps!
R code:
x<-matrix(c(212,144,256,707),2,2)
library(exact2x2)
mcnemar.exact(x)
R coutput:
mcnemar.exact(x)
Exact McNemar test (with central confidence intervals)
data: x
b = 256, c = 144, p-value = 2.331e-08
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
1.443859 2.195911
sample estimates:
odds ratio
1.777778
Since p value < 0.05 level of significance, there is sufficient evidence to conclude that school children are more likely to have severe colds at a younger age.
Repeat part (b) but use the function mcnemar.test() for these data.
R code:
mcnemar.test(x,correct=FALSE)
R output:
McNemar's Chi-squared test
data: x
McNemar's chi-squared = 31.36, df = 1, p-value = 2.144e-08
Since p value < 0.05 level of significance, there is sufficient evidence to conclude that school children are more likely to have severe colds at a younger age.
Compare the p-values in parts b and c and explain any similarities (or differences).
The p-values are very low in parts b and c and the p values results in similar inference.