R T Test Weightloss example E11.8
Hi there,
I don't understand the Solution for E11.8.
H0: muB-muA >=0 ok! alternativ should be then
H1: muB-muA <0 The solution's t.test Syntax is:
dep.t.test <- t.test(weight$before, weight$after, paired = TRUE, alternative = "g") shouldn't it be: dep.t.test <- t.test(weight$before, weight$after, paired = TRUE, alternative = "less") Thanks for the Help.
Greets
Alex
H0: muB-muA >=0 ok! alternativ should be then
H1: muB-muA <0 The solution's t.test Syntax is:
dep.t.test <- t.test(weight$before, weight$after, paired = TRUE, alternative = "g") shouldn't it be: dep.t.test <- t.test(weight$before, weight$after, paired = TRUE, alternative = "less") Thanks for the Help.
Greets
Alex
1 answers ( 0 marked as helpful)
Hi Alex, thanks for the question and apologies for the delay in response -- unfortunately, this got lost in the threads somehow.
Not quite. But I do see now that the way I've stated the H0 might be a little confusing -- I am editing the file now.
Anyhow, so...
The code in the solution is going off of this formulation of the hypotheses:
H0: muB - muA <= 0 OR D0 <= 0 (as defined here, the D is a negative number; or in the After condition people are either keeping their weight or increasing it)
H1: muB - muA > 0 OR D1 > 0 (as defined here, the D is a positive number)
So, in our code, we'd set the alternative argument in the code to "g" or the true difference in means is "more than zero"!
365 Team
dep.t.test <- t.test(magn$Before, magn$After, paired=TRUE, alternative = "g")
Hopefully, this is helpful.
Thank you for the question!
Best wishes,
Simona365 Team