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:
When we look at the predicted values, these are also read out in R:
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, this is the result:
Investigating relationships in the data
We can see the column names in the model by using the names
command. In our example, it will appear as follows:
names(linearregressionmodel)
When we use this command, we get the following columns:
[1] "coefficients" "residuals" "effects" [4] "rank" "fitted.values" "assign" [7] "qr" ...