代写STAT 440作业、代做data留学生作业、代做c/c++，Python，Java程序设计作业帮做C/C++编程|代写Database

STAT 440: Homework 7 Due: 3/17 at 3:00pm
1. Consider the anorexia dataset in the MASS package. This data considers two treatments for anorexia,
one based on Cognitive Behavorial Treatment (CBT) sessions from a professional therapist and another
based on family oriented treatment sessions (FT). The Treat variable is a factor with three levels: Cont
(control, no treatment), CBT, and FT. For each subject two weights (in lbs) were measured, one before
(Prewt) and one after (Postwt) treatment.
(a) Create a new variable, Outcome, that indicates if the post-weight is higher than the pre-weight,
thus denoting whether or not the treatment was successful. Design a figure that compares the
success of the three treatment groups graphically (e.g. a barplot).
(b) Using a uniform prior, compute and plot the posterior densities of the proportion of successes for
each treatment level.
(c) Use Monte Carlo with your posterior distributions to obtain confidence/credible intervals for the
difference in success proportions when comparing CBT to Cont and FT to Cont. What can you
conclude in terms of the data?
2. Consider the esoph dataset in the datasets package. This data considers cases of esophageal cancer in
a town in France. Each row of the data consists of an entire group of subjects and summarizes how
many cases (have esophageal cancer) and controls (no cancer) are in the group. The other variables
describe the group: agep denotes the age range of theg group,  alcgp the daily alcohol consumption,
and tobgp the daily tobacco consumption.
(a) Create a new binary variable, Usage, that denotes 0 for little to no tobacco use (0–9 gm/day)
and medium to high use that includes the other categories. Again, graphically compare the
cass/controls against this new variable.
(b) Using a uniform prior, compute and plot the posterior densities of the proportion of cases for
Usage level.
(c) Use Monte Carlo with your posterior distributions to obtain confidence/credible intervals for the
difference in case proportions when comparing the two levels of usage. What can you conclude in
terms of the data?
(d) Instead of the difference in proportions, repeat the previous part, but now comparing the difference
of the log odds. Now convert this interval into an interval for the odds ratio. Draw your conclusions
in terms of the odds ratio by giving a point estimate in addition to a confidence/credible interval
and interpreting the point estimate in the context of the problem.

• QQ：99515681
• 邮箱：99515681@qq.com
• 工作时间：8:00-23:00
• 微信：codehelp