ST790R -- Fall 2009 Homework #6 -- due Thursday, 05 November 2009 Exercises in Textbook: (*just turn in these) 10.2, *10.6(just 3 points), 10.8 New Exercises: *1) Repeat Exercise 10.2 by generating from the exponential distribution. For a modest sized sample, estimate the variance of your estimate of the integral, and determine the sample size (N) needed to get the error below 1e-5. (No need to generate a sample of size N; no need for a tail bound t.) 2) Recall the logistic regression Example 9.7 in chex97.r/out with one covariate. Mimic chex102s.r or chex102g.r to find the posterior mean vector and covariance matrix with a flat prior. (or chex102n.r) *3) Many NC health statistics are reported as county rates, that is, cases per 1000 residents. A reasonable model for the variance for these rates is sigma^2 + gamma^2/pop(i) where pop(i) is the population of the county. In the file 'ncinfmort.ddat' are county population (k), infant death rates (deaths/1000), household income ($k), and poverty rate. We want to fit a regression model of the form infdr(i) = beta0 + beta1*hinc(i) + beta2*pov(i) + e(i) where indr(i) is infant death rate, hinc(i) household income, and pov(i) poverty rate in county i=1,...,N=100. a) Compute least squares estimates for the model above. b) Compute preliminary estimates for sigma^2 and gamma^2 by regressing the square of the residuals on 1/pop(i). c) Compute ML estimates of the parameters (3 beta's, two variance params) fitting the regression model with the covariance model that depends on population. (likelihood from y ~ N(Xb,V), V=diag(sigma^2+gamma^2/pop) ) (also report standard errors for MLE's) d) Do a LRT of H: gamma^2 = 0 at level 0.05.