7.7 Example

Using a cleaned version of the Lung function data set from PMA5, lets explore the relationship between height and FEV for fathers in this data set.

There does appear to be a tendency for taller men to have higher FEV1. Let’s fit a linear model and report the regression parameter estimates.

The least squares equation is \(Y = -4.087 + 0.118X\).

For ever inch taller a father is, his FEV1 measurement significantly increases by .12 (95%CI: .09, .15, p<.0001).
The correlation between FEV1 and height is \(\sqrt{.2544}\) = 0.5.

Lastly, check assumptions on the residuals to see if the model results are valid.

  • Homogeneity of variance

  • Normal residuals

No major deviations away from what is expected.

7.7.1 Confidence and Prediction Intervals

If we set the se argument in geom_smooth to TRUE, the shaded region is the confidence band for the mean. To get the prediction interval, we have to use the predict function.