Comparing actual values with predicted results

Now, we will look at real values of weight of 15 women first and then will look at predicted values. Actual values of weight of 15 women are as follows, using the following command:

women$weight

When we execute the women$weight command, this is the result that we obtain:

Comparing actual values with predicted results

When we look at the predicted values, these are also read out in R:

Comparing actual values with predicted results

How can we put these pieces of data together?

women$pred <- linearregressionmodel$fitted.values

This is a very simple merge. When we look inside the women variable again, ...

Get Advanced Analytics with R and Tableau now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.