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.

版权所有：留学生编程辅导网 2020,All Rights Reserved 联系方式：QQ:99515681 电子信箱：99515681@qq.com

免责声明：本站部分内容从网络整理而来，只供参考！如有版权问题可联系本站删除。