In: Statistics and Probability
The following data represents females' weights before and after pregnancy.
Weight Before Pregnancy, 114, 107, 123, 118, 136, 119, 127, 123, 129, 134, 134, 131, 132, 124, 134, 112, 122, 114, 109, 114, 116, 133, 129, 127, 128, 122, 134, 121, 122, 118, 126, 120, 118, 131, 124, 108, 127, 127, 129, 136
Weight After Pregnancy, 168, 161, 166, 157, 158, 166, 156, 157, 154, 153, 159, 158, 155, 164, 166, 157, 161, 166, 162, 148, 158, 165, 164, 159, 160, 154, 163, 169, 154, 150, 164, 160, 160, 157, 155, 163, 160, 162, 166, 157
a) Formulate the hypotheses that test whether or not the weights before and after pregnancy are the same
b) Test aforementioned hypotheses using R
For your answer please provide the following: R code to that you have used for testing, output of your test, and your reasoning and conclusions
Solution:
a) Let xi: Weight before pregnancy
and yi: Weight after pregnancy.
di=yi-xi
Here the situation is suitable for paired t-test.
Ud: Average difference in weights.
The hypothesis for the test can be given as
H0:Ud=0 V/s H1:Ud0
b) R-code:-
> xi=c(114, 107, 123, 118, 136, 119, 127, 123, 129, 134, 134,
131, 132, 124, 134, 112, 122, 114, 109, 114, 116, 133, 129, 127,
128, 122, 134, 121, 122, 118, 126, 120, 118, 131, 124, 108, 127,
127, 129, 136)
> yi=c(168, 161, 166, 157, 158, 166, 156, 157, 154, 153, 159,
158, 155, 164, 166, 157, 161, 166, 162, 148, 158, 165, 164, 159,
160, 154, 163, 169, 154, 150, 164, 160, 160, 157, 155, 163, 160,
162, 166, 157)
> t.test(xi,yi,paired=T,)
Paired t-test
data: xi and yi
t = -23.593, df = 39, p-value < 2.2e-16
alternative hypothesis: true difference in means is less than
0
95 percent confidence interval:
-Inf -33.42914
sample estimates:
mean of the differences
-36
Decision Rule:
Here p-value <=0.05
We reject H0 at 5% level of Significance.
Conclusion:
Given data shows that the weights before and after pregnancy are not same.