11.07.2015 Views

statisticalrethinkin..

statisticalrethinkin..

statisticalrethinkin..

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

212 6. MODEL SELECTION, COMPARISON, AND AVERAGING6.7.1. An average polynomial. Let h i and x i be the height and centered age values, respectively,on row i. Fit the following models to the data in d1:M 1 : h i ∼ Normal(µ i , σ),µ i = α + β 1 x i .M 2 : h i ∼ Normal(µ i , σ),µ i = α + β 1 x i + β 2 x 2 i .M 3 : h i ∼ Normal(µ i , σ),µ i = α + β 1 x i + β 2 x 2 i + β 3 x 3 i .M 4 : h i ∼ Normal(µ i , σ),µ i = α + β 1 x i + β 2 x 2 i + β 3 x 3 i + β 4 x 4 i .M 5 : h i ∼ Normal(µ i , σ),µ i = α + β 1 x i + β 2 x 2 i + β 3 x 3 i + β 4 x 4 i + β 5 x 5 i .M 6 : h i ∼ Normal(µ i , σ),µ i = α + β 1 x i + β 2 x 2 i + β 3 x 3 i + β 4 x 4 i + β 5 x 5 i + β 6 x 6 i .Use map to fit these.Note that fitting all of these polynomials to the height-by-age relationship is not a good way toderive insight. It would be better to have a simpler approach that would allow for more insight, likeperhaps a piecewise linear model. But the set of polynomial families above will serve to help youpractice and understand model comparison and averaging.(a) Compare the models above, using AICc. Compare the model rankings, as well as the AICcweights.(b) For each model, produce a plot with model averaged mean and 95% confidence interval ofthe mean, superimposed on the raw data. How do predictions differ across models?(c) Now also plot the model averaged predictions, across all models. In what ways do the averagedpredictions differ from the predictions of the model with the lowest AICc value?6.7.2. Cross-validate. (a) Compute the test-sample deviance for each model. is means calculatingdeviance, but using the data in d2 now. You can compute the log-likelihood of the height datawith:R code6.30 sum( dnorm( d2$height , mu , sigma , log=TRUE ) )where mu is a vector of predicted means (based upon age values and MAP parameters) and sigma isthe MAP standard deviation.(b) Compare the deviances from (a) to the AICc values. It might be easier to compare if yousubtract the smallest value in each list from the others. For example, subtract the minimum AICcfrom all of the AICc values so that the best AICc is normalized to zero. Which model makes the bestout-of-sample predictions in this case? Does AICc do a good job of estimating the test deviance?

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!