Module # 8 Assignment- ANOVA test
3/6/25
This week's work was both engaging and insightful. I particularly enjoyed the problems we worked on, as they were highly relevant and informative. The exercises provided a great opportunity to apply statistical concepts in a practical way, reinforcing my understanding of ANOVA tests, t-tests, and data structuring in R. Even though the ANOVA test didn’t show a significant difference, it was a good reminder that not every dataset will give clear results.
1. A researcher is interested in the effects of drug against stress reaction. She gives a reaction time test to three different groups of subjects: one group that is under a great deal of stress, one group under a moderate amount of stress, and a third group that is under almost no stress. The subjects of the study were instructed to take the drug test during their next stress episode and to report their stress on a scale of 1 to 10 (10 being most pain).
| High Stress | Moderate Stress | Low Stress |
| 10 | 8 | 4 |
| 9 | 10 | 6 |
| 8 | 6 | 6 |
| 9 | 7 | 4 |
| 10 | 8 | 2 |
| 8 | 8 | 2 |
Report on drug and stress level by using R. Provide a full summary report on the result of ANOVA testing and what does it mean. More specifically, report using the following R functions: Df, Sum, Sq Mean, Sq, F value, Pr(>F)
ANOVA Test Results:
Degrees of Freedom (Df):
- Stress Level: 2.0
- Residuals: 15.0
Sum of Squares (Sum Sq):
- Stress Level: 82.11
- Residuals: 28.83
Mean Squares (Mean Sq):
- Stress Level: 41.06
- Residuals: 1.92
F-value: 21.36
p-value (Pr(>F)): 0.00004
As one can see from the ANOVA test, since the p-value (0.00004) is less than 0.05, this indicates a statistically significant difference in reaction times between at least one of the stress groups. This suggests that stress levels do have an effect on reaction time despite taking the drug. In order to determine which specific stress groups exhibit notable differences in reaction time, additional research must be executed, specifically a Tukey's HSD.
2. From our Textbook:Introductory Statistics with R. Chapter 7. 7.6 Exercises #7.1 pp. 143.
The zelazo data (taken from textbook's R package called ISwR) are in the form of a list of vectors, one for each of the four groups. Convert the data to a form suitable for the user of lm, and calculate the relevant test. Consider t tests comparing selected subgroups or obtained by combing groups.
2.1 Consider ANOVA test (one way or two-way) for this dataset (zelazo)
Recommendations
In order to get zelazo dataset, here are the code you need to run:
>install.packages("ISwR")
>data("zelazo")
The result
> zelazo
$active
[1] 9.00 9.50 9.75 10.00 13.00 9.50
$passive
[1] 11.00 10.00 10.00 11.75 10.50 15.00
$none
[1] 11.50 12.00 9.00 11.50 13.25 13.00
$ctr.8w
[1] 13.25 11.50 12.00 13.50 11.50
The Zelazo dataset consists of four groups: Active, Passive, None, and Ctr.8w, each representing different intervention conditions. The data was originally in the form of a list of vectors and was converted into a structured data frame (zelazo_df) to facilitate statistical analysis using ANOVA and t-tests.
The One-Way ANOVA test was conducted to determine if there were significant differences in scores across the four groups. The results showed an F-value of 2.142 and a p-value of 0.129, indicating that the differences among the group means were not statistically significant at the 5% level. Since the p-value is greater than 0.05, we fail to reject the null hypothesis, suggesting that there is no strong evidence that any group performed significantly differently from the others.
Pairwise t-tests were conducted between selected groups to investigate further differences. The Active vs. Passive comparison yielded a p-value of 0.2281, indicating no significant difference. The Active vs. None comparison resulted in a p-value of 0.09434, which is close to significance but does not meet the conventional threshold of 0.05. The Passive vs. None comparison showed a p-value of 0.7438, confirming no meaningful difference. Overall, while there is some indication that the Active and None groups may differ, the sample size might be too small to detect a statistically significant effect.
In conclusion, the ANOVA results indicate no significant differences across groups, and the t-tests confirm that no strong pairwise differences exist.
Comments
Post a Comment