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.

5.1. SPURIOUS ASSOCIATION 143(a)(b)Predicted divorce6 8 10 12(c)Divorce error-4 -2 0 2 4IDUT6 8 10 12Observed divorceMEAR ALGAMSSCID0 10 20 30 40Waffles per capitaMEARALAKKYGAOKCORILAMSINNHTNAZSDORVTWVNMWAMAMDKSIAOHNCDCDEMITXHIVAMOWYILMTFLCANYPAWISCNEUTCTNDMNNJID-6 -4 -2 0 2 4FIGURE 5.7. Posterior predictive plots for the multivariate divorce model,m5.3. (a) Predicted divorce rate against observed, with 95% confidence intervalsof the average prediction. e dashed line shows perfect prediction.(b) Average prediction error for each State, with 95% interval of the mean(black line) and 95% prediction interval (gray +). (c) Average predictionerror (residuals) against number of Waffle Houses per capita, with superimposedregression of the two variables.Utah (UT), both of which have much lower divorce rates than the model expects them tohave. e easiest way to label a few select points is to use identify:identify( x=d$Divorce , y=mu , labels=d$Loc , cex=0.8 )R code5.12Aer executing the line of code above, R will wait for you to click near a point in the activeplot window. It’ll then place a label near that point, on the side you choose. When you aredone labeling points, press your right mouse button (or press ESC, on some platforms).e plot in FIGURE 5.7(a) makes it hard to see the amount of prediction error, in manycases. For this reason, lots of people also use residual plots that show the mean prediction

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

Saved successfully!

Ooh no, something went wrong!