Exercise

# Prediction intervals for the individual response

Along with an interval estimate for the expected value of the response, it is often desired to have an interval estimate for the actual individual responses. The formulation for the prediction is the same, but the predicted points are more variable around the line, so the standard error is calculated to be a larger value.

As with the interval around the expected average values, the interval for predicted individual values is smaller in the middle than on the extremes due to the calculation of the regression line being more stable at the center. Note that the intervals for the average responses are much smaller than the intervals for the individual responses.

You have already seen `tidy()`

, to pull out coefficient-level information from a model, and `augment()`

for observation-level information. `glance()`

completes the triumvirate, giving you model-level information.

The linear regression is provided as `model`

and the predictions from the previous exercise are given as `predictions`

.

Instructions 1/3

**undefined XP**

- Find the natural variability of the points around the prediction line.
- Use
`glance()`

to get the model-level information from`model`

. - Pull out the
`sigma`

element.

- Use
- Calculate the standard error of the predictions as the square root of the sum of (
`twins_sigma`

squared and`.se.fit`

squared).