Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

7.6 Diabetes data: A population of 532 women living near Phoenix, Arizona were tested for diabetes. Other information was gathered from these women at the time of testing, including number of...

1 answer below »
7.6 Diabetes data: A population of 532 women living near Phoenix, Arizona were tested for diabetes. Other information was gathered from these women at the time of testing, including number of pregnancies, glucose level, blood pressure, skin fold thickness, body mass index, diabetes pedigree and age. This information appears in the file azdiabetes.dat. Model the joint distribution of these variables for the diabetics and non-diabetics separately, using a multivariate normal distribution: a) For both groups separately, use the following type of unit information prior, where Sˆ is the sample covariance matrix. i. µ0 = y¯, ?0 = Sˆ; ii. S0 = Sˆ, ?0 = p + 2 = 9 . Generate at least 10,000 Monte Carlo samples for {?d, Sd} and {?n, Sn}, the model parameters for diabetics and non-diabetics respectively. For each of the seven variables j ? {1, . . . , 7}, compare the marginal posterior distributions of ?d,j and ?n,j . Which variables seem to differ between the two groups? Also obtain Pr(?d,j > ?n,j |Y) for each j ? {1, . . . , 7}. b) Obtain the posterior means of Sd and Sn, and plot the entries versus each other. What are the main differences, if any?
Answered Same Day Dec 27, 2021

Solution

David answered on Dec 27 2021
102 Votes
AZDiabetes
Code for diabetics data
# constants
N=532
nt=38
mut=-.5
sig2=3
sig=sqrt(sig2)
# log target
ta=function(x){
-N*log(1+exp(x))+x*nt-(x-mut)^2/(2*sig2)
}
#bounding constant
mean=mut-sig2*(N-nt)
uc=0.5*log(2*pi*sig2)+(bmean^2-mut^2)/(2*sig2)...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here