HW 14 Stat 705 Fall 2015 Assigned Saturday 11/14/15 DUE Monday 11/23/15 (A) Start by running the following lines to generate a small illustrative simulated dataset exactly the same as one I generated. > set.seed(3) x = runif(100) y = 3 - 7*x + 10*abs(x-.5)^1.5*rnorm(100) Dset = cbind.data.frame(y, x) VERIFY that weighted least squares models y ~x fitted to this dataset in two different ways, (1) using lm with weights = b(x), and (2) using lm (without an intercept!) with ystar = y*sqrt(b(x)) and model-matrix columns all also multiplied componentwise by sqrt(b(x)) give IDENTICALLY the same results in estimated coefficients and significance levels and (after you transform back from ystar to y under method (2)) also in "fitted" (ie predictors) and residuals. Here your choice of weights b(x) should be based on the model assumption in such a way that Y*b(X) conditionally given X is normally distributed with constant variance (and mean depending on X). (B) Generate a dataset the same as mine using the statements > set.seed(3577) x = rgamma(250, 0.7) z = sample(1:4, 250, replace=T, prob=c(0.2,0.3,0.3,0.2)) nv = rep(c(5,10),125) y = rbinom(250, nv, plogis(0.3 + 1.2*x - 0.7*z)) AuxFr = cbind.data.frame(y,x,z,nv) -- Fit a probit model for y (or y/nv) in terms of predictor variables x and z. -- Obtain the NULL deviance and the Residual Deviance from the model. (The residual deviance is simply called Deviance in the model outputs unless you run anova(.) on the model. -- Show how to obtain these deviances by calculating the Probit Model logLikelihoods, either directly or by using other R functions that calculate log-likelihoods, or both.