In: Statistics and Probability
The following data are for pre-exercise and post-exercise body temperature measure- ments for eight young adults.
Individual Number 1
2
3
4
5
6
7
8
Resting (R) 99.0 97.8 98.6 98.7 98.7 98.2 98.7 98.6
Post-Exercise (P) 99.4
98.1
98.6
98.7
98.7
98.2
98.8
99.2
(a) In R, Define a vector
(b) In R, Define a vector
(c) In R, Define a vector
R for the pre-exercise (i.e., resting) body temperature. P for the pre-exercise (i.e., resting) body temperature. D for the difference P − R.
(d) Using R, determine the mean of D and the standard deviation of D.
(e) What are the null hypothesis, H0, and the alternative hypothesis, Ha, if one wanted to determine whether or not there is a difference in mean body tempera- ture following exercise?
(f) Show how the t-statistic would be calculated by hand using the information de- termined in parts (d)-(e).
(g) Use the quantile function (as described in Part 2) to find the critical t-value(s). Verify your result(s) with an appropriate probability table.
(h) Based on your results from parts (f) and (g), do you reject the null hypothesis? Explain.
(i) Now, use the t.test function in R (as described in Part 2) to run a t-test to test your null hypothesis from (e). Note that this is a paired t-test since we are comparing measured data for the same individual from before and again after a treatment. *PLEASE POST ALL R INPUT & OUTPUT
> pre_exercise=c(99.0, 97.8, 98.6, 98.7, 98.7, 98.2, 98.7, 98.6)
> Post_Exercise=c(99.4,98.1,98.6,98.7,98.7,98.2,98.8,99.2)
> D=Post_Exercise-pre_exercise
> mean_D=mean(D)
> mean_D
[1] 0.175
> Std_D=sd(D)
> Std_D
[1] 0.231455
#(e) What are the null hypothesis, H0, and the alternative
hypothesis, Ha, if one wanted to determine whether or not there is
a difference in mean body tempera- ture following exercise?
Ho:µD = 0
H1 : µD ≠ 0
(f) Show how the t-statistic would be calculated by hand using the information
(i)
> test=t.test(Post_Exercise,pre_exercise,paired = TRUE)
> test
Paired t-test
data: Post_Exercise and pre_exercise
t = 2.1385, df = 7, p-value = 0.06979
alternative hypothesis: true difference in means is not equal to
0
95 percent confidence interval:
-0.01850124 0.36850124
sample estimates:
mean of the differences
0.175
Accept the null hypothesis there is no difference between pre-exercise and post-exercise