ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Inference for Linear Regression in R

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

twins_sigma <- model %>%
  # Get model-level information
  ___ %>%
  # Pull out sigma
  ___

predictions %>%
  # Calculate the std err of the predictions
  mutate(std_err_of_predictions = ___)
Editar y ejecutar código