Session Ready
Exercise

Augmenting your data

From the results of glance(), you learned that using the available features the linear model fits well with an adjusted \(R^2\) of 0.99. The augment() function can help you explore this fit by appending the predictions to the original data.

Here you will leverage this to compare the predicted values of life_expectancy with the original ones based on the year feature.

Instructions
100 XP
  • Build the augmented dataframe algeria_fitted using augment().
  • Visualize the fit of the model with respect to year by plotting both life_expectancy as points and .fitted as a line.