Session Ready
Exercise

Multivariate linear regression (Part 2)

Now you will make predictions using the blood pressure model bloodpressure_model that you fit in the previous exercise.

You will also compare the predictions to outcomes graphically. ggplot2 is already loaded in your workspace. Recall the plot command takes the form:

ggplot(dframe, aes(x = pred, y = outcome)) + 
     geom_point() + 
     geom_abline(color = "blue")

`

Instructions
100 XP

The objects bloodpressure and bloodpressure_model are in the workspace.

  • Use predict() to predict blood pressure in the bloodpressure dataset. Assign the predictions to the column prediction.
  • Graphically compare the predictions to actual blood pressures. Put predictions on the x axis. How close are the results to the line of perfect prediction?