In: Statistics and Probability
2. The dataset ’anorexia’ in the MASS package in R-Studio contains data for an anorexia study. In the study, three treatments (Treat) were applied to groups of young female anorexia patients, and their weights before (Prewt) and after (Postwt) treatment were recorded. The three treatments adminstered were no treatment (Cont), Cognitive Behavioural treatment (CBT), and family treatment (FT).
Determine at the 5% significance level if Cognitive Behavioral treatment is effective in helping patients gain weight. Perform all necessary steps for the hypothesis test and interpret your results in the context of the study. Assume random selection and normal population distribution for all samples and populations.
Important: Make sure the MASS package is selected under the packages tab in R-Studio.
Useful Tip: The command subset(anorexia, Treat == "Cont")$Prewt could be used to access just the Prewt values for subjects in the Cont treatment group.
please be as detailed as possible, thank you!
ANSWER::
#### R Statistical
Software ####
library(MASS)
data(anorexia)
Predata = subset(anorexia, Treat
== "Cont")$Prewt
Postdata = subset(anorexia, Treat
== "Cont")$Postwt
t.test(Postdata,
Predata, alternative
= "greater",
conf.level = 0.95, paired
= TRUE)
##
## Paired t-test
##
## data: Postdata and Predata
## t = -0.28723, df = 25, p-value = 0.6118
## alternative hypothesis: true difference in means is greater than
0
## 95 percent confidence interval:
## -3.126168 Inf
## sample estimates:
## mean of the differences
##
-0.45
## p-value
is greater than alpha fail to reject H0, implies there is no
significant gain in weight
## after
treatment
NOTE:: I HOPE THIS ANSWER IS HELPFULL TO YOU........***PLEASE SUPPORT ME WITH YOUR RATING....
**PLEASE GIVE ME "LIKE"........PLEASE SUPPORT ME ..........THANK YOU