Module 8 Assignment

 A researcher is interested in the effects of drug against stress reaction. She gives a reaction time to three different groups of subjects: one group that is under a great deal of stress, one group that is under a moderate amount of stress, and a third group that is under almost no stress. The subjects od 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).

  1. Report on drug and stress level by using R. Provide a full summary report on the results 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)









Fist I created a data frame using the data provided, which includes three columns of different levels of stress high, moderate, and low. The data from these columns were combined into a single vector called "data.combined" to simplify assigning group labels, with each stress levels repeated six times to match the number of observations. The ANOVA test was performed determine whether significant differences appeared among the three level of stress, and the summary() functions was used to analyze the results. The output of the ANOVA showed 2 degrees of freedom (df) for the stress level groups, a sum of squares (Sum Sq) of 82.11, and a mean of square (Mean Sq) of 41.06 (82.11 / 2). The f - statistic was 21.36, calculated by dividing the group mean square by the residual mean square (41.06 / 1.92), and the p - value was 4.08e - 05, indicating a statistically significant result. The large f value with the low p-value, it provides strong evidence against the null hypothesis, showing that the mean stress level differs significantly among the three groups.

     2. 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. Consider ANOVA test (one way or two-way) for this dataset (zelazo).

















For this part, I used the zelazo data set from the ISwR package, converted it into a suitable format for the lm() function and performed the necessary statistical tests. After loading the dataset as data2, I examined its attributes using summary() and created a data frame with the added group variable representing the four conditions. I ran a linear regression model regressing values on the group variable, which produced estimated coefficient of 10.125, 1.250,1.583, and 2.225. The two-sample t-testing compared groups 1 and 2 to show the means of 10.125 and 11.375, with a p-value of 0.2301, indicating no significant difference. The ANOVA  test using aov() yielded a group sum sq of 14.78, residual sum sq of 43.69, and degrees of freedom of 3 and 19, respectively. The results confirmed that there were no statistically significant differences among the groups, consistent with the t-test findings.



Comments

Popular posts from this blog

Module 5 Assignment

Module 2 Assignment LIS4273

Module 6 Assignment