11.07.2015 Views

statisticalrethinkin..

statisticalrethinkin..

statisticalrethinkin..

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

112 4. LINEAR MODELSheight140 150 160 170 180FIGURE 4.5. Height in centimeters (vertical) plottedagainst weight in kilograms (horizontal), withthe maximum a posteriori line for the mean heightat each weight plotted in black.30 35 40 45 50 55 60weightthe outcome, when the predictor is at its average value. is makes interpreting the intercepta lot easier.4.4.3.2. Plotting posterior inference against the data. It’s almost always helpful to plot theposterior inference against the data. Not only does plotting help in interpreting the posterior,but it also provides an informal check on model assumptions. When the model’s predictionsdon’t come close to key observations or patterns in the plotted data, then you might suspectthe model is badly specified and return to critique its assumptions.But even if you only treat plots as a way to help in interpreting the posterior, they areinvaluable. For simple models like this one, it is easy to just read the table of numbers andunderstand what the model says. But for even slightly more complex models, especiallythose that include interaction effects (Chapter 7), interpreting posterior distributions is hard.Combine with this the problem of incorporating the information in vcov into your interpretations,and the plots are irreplaceable.We’re going to start with a simple version of that task, superimposing just the MAP valuesover the height and weight data. e we’ll slowly add more and more information to theprediction plots, until we’ve used the entire posterior distribution.To superimpose the MAP values for mean height over the actual data:R code4.42plot( height ~ weight , data=d2 )abline( a=coef(m4.3)["a"] , b=coef(m4.3)["b"] )You can see the resulting plot in FIGURE 4.5. Each point in this plot is a single individual.e black line is defined by the MAP slope β and MAP intercept α. Notice that in the codeabove, I pulled the numbers straight from the fit model. e function coef returns a vectorof MAP values, and the names of the parameters extract the intercept and slope.4.4.3.3. Adding uncertainty around the mean. e MAP line is just the posterior mean,the most plausible line in the infinite universe of lines the posterior distribution has considered.Plots of the MAP line, like FIGURE 4.5, are useful for getting an impression of themagnitude of the estimated influence of a variable, like weight, on an outcome, like height.But they do a poor job of communicating uncertainty. Remember, the posterior distributionconsiders every possible regression line connecting height to weight. It assigns a

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

Saved successfully!

Ooh no, something went wrong!