Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem 1: Answer the following questions using the attached file “Stress Reduct

ID: 3367164 • Letter: P

Question

Problem 1:

Answer the following questions using the attached file “Stress Reduction”.

Notes:

Use an alpha level of 0.05 for all relevant questions.

Problem 1 should be solved using R.

File description:

The file represents a hypothetical sample of 23 participants who are divided into three stress reduction treatment groups (mental, physical, and medical) and two age groups (old and young). The stress reduction values are represented on a scale that ranges from 1 to 10. The researchers in this study investigated the effect of using different stress reduction treatments and age. (File attached at the bottom)

The file includes the following variables:

“Age”: categorical variable, age of participants, two levels: old and young

“Treatment": categorical variable, specifying one of three treatment methods: mental, physical, and medical

“Score”: numerical variable, stress reduction scores from 1-10

Carry out the appropriate statistical test in R to test the hypothesis that there is a significant difference in the treatment methods.

Which treatment(s) lead(s) to the highest stress reduction score?

Carry out the appropriate statistical test in R to test the hypothesis that there is a significant difference in between old and young participants.

Which age group(s) responded better to the treatments-has/have the highest stress reduction score-?  

Note: In each part, you need to do the following:

Write the type of test you are using and briefly explain why you running that test.

Write the corresponding p-values.

Answer the specific question.

NO need to include pics from R.

Treatment Age Score

1 mental young 10

2 mental young 9

3 mental young 9

4 mental young 8

5 mental old 8

6 mental old 4

7 mental old 4

8 mental old 4

9 physical young 9

10 physical young 8

11 physical young 7

12 physical young 6

13 physical old 5

14 physical old 4

15 physical old 3

16 physical old 2

17 medical young 8

18 medical young 7

19 medical young 6

20 medical young 5

21 medical old 4

22 medical old 4

23 medical old 4

Explanation / Answer

Loaded the given data file in a dataframe Stress.Reduction

We see that the variable Age and Treatment are already defined as categorical variables by R.

> str(Stress.Reduction)
'data.frame':   23 obs. of 3 variables:
$ Treatment: Factor w/ 3 levels "medical","mental",..: 2 2 2 2 2 2 2 2 3 3 ...
$ Age : Factor w/ 2 levels "old","young": 2 2 2 2 1 1 1 1 2 2 ...
$ Score : int 10 9 9 8 8 4 4 4 9 8 ...

Carry out the appropriate statistical test in R to test the hypothesis that there is a significant difference in the treatment methods.

As, the number of levels of Treatment variable is greater than 2, we will conduct one-way ANOVA test for any significant difference in the treatment methods.

Null hypothesis H0: There is no significant difference in stress reduction score for different treatment methods.

Alternative hypothesis H1: Atleast one of treatment methods stress reduction score is significantly different from others.

Run the regression model and anova test with the below set of commands in R.

> model = lm(Score ~ Treatment, data = Stress.Reduction)
> anova(model)
Analysis of Variance Table

Response: Score
Df Sum Sq Mean Sq F value Pr(>F)
Treatment 2 12.285714 6.1428571 1.18457 0.32644
Residuals 20 103.714286 5.1857143   

The p-value is 0.32644 which is greater than 0.05 significance level. So, we fail to reject the null hypothesis and conclude that there is no significant evidence that atleast one of treatment methods stress reduction score is significantly different from others.

Which treatment(s) lead(s) to the highest stress reduction score?

By running the command,

> tapply(Stress.Reduction$Score,Stress.Reduction$Treatment,mean)
medical mental physical
5.428571429 7.000000000 5.500000000

we see that the highest mean stress reduction score is for mental treatment. Although the difference is not significant.

Carry out the appropriate statistical test in R to test the hypothesis that there is a significant difference in between old and young participants.

As, the number of levels of Age variable is 2, we will conduct t test for any significant difference of stress reduction score in the age.

Null hypothesis H0: There is no significant difference in stress reduction score between young and old.

Alternative hypothesis H1: There is significant difference in stress reduction score between young and old.

Run the below command in R for the t test.

> t.test(Score ~ Age, data = Stress.Reduction)

   Welch Two Sample t-test

data: Score by Age
t = -5.6268534, df = 20.887715, p-value = 1.413954e-05
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-4.773226105 -2.196470865
sample estimates:
mean in group old mean in group young
4.181818182 7.666666667

The p-value of the test is 1.413954 * 10-5 which is less than 0.05 significance level. So, reject the null hypothesis and conclude that there is significant evidence of differences in stress reduction scores between young and old.

Which age group(s) responded better to the treatments-has/have the highest stress reduction score-?

As, mean stress reduction score in young age (7.66) is greater than the old age, young age has the highest stress reduction score.