In the previous lecture, we created a plot between residuals and independent variables. In the same fashion, we can create a plot between residuals and fitted values. Remember, we can find fitted values in R using the function -  fitted(model)  . Now, we can create a plot by following command:

plot(fitted(model), resid(model)

We can create a horizontal line through 0 of the vertical axis as shown below -

This was created by adding following command below the previous one -

abline(0,0)

if we replicate the same thing for the second model using the following command:

plot(fitted(model2), resid(model2)

abline(0,0)

We get the following plot -

it is evident that in the second plot, equal number of points are above 0 as they are below 0. Hence, assumption that y is a linear function of x is valid (in this case, y is variable "c" and x is "a").