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 anotherbased 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 the difference between post and pre weight measurement.To check normality, construct an appropriate histogram and qqplot. Comment on theresults.(b) Consider the mean of your outcome variable for the control and FT groups only. For each groupmean, compute the posterior distributions using a normal prior with mean 0 and variance 20.Estimate the standard deviation of the observations from each group using the sample standarddeviations, but treat them as “known” in your posterior calculations (so you are only putting aprior on the means). Plot both posterior densities on the same plot.(c) Use Monte Carlo with your posterior distributions to obtain confidence/credible intervals forthe difference in the average outcome variable betwee the FT and Cont groups. What can youconclude in terms of the data?2. Consider the same data as in problem 1. Repeat parts (b) and (c), but now examining the varianceinstead of the mean (of your outcome variable). You will now estimate the means using the samplemeans and then treat them as known in your posterior calculations. Use inverse gamma priors withmean 50 and variance 200.
版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。