Visualizing fitted values

To get a closer look at our model outputs, we have to take a closer look at the linear_regression_revenues object we have just created. What kind of object is it? How would you check this?

We can conveniently employ the mode() function for this:


This tells us that linear_regression_revenues is a list. And what is this list composed of? Just look at the str() output to find out:

str(linear_regression_revenues) List of 12 $ coefficients : Named num [1:2] 2.75 5.84e-08 ..- attr(*, "names")= chr [1:2] "(Intercept)" "company_revenues" $ residuals : Named num [1:11523] -0.695 -0.754 -0.754 -0.754 -0.754 ... ..- attr(*, "names")= chr [1:11523] "1" "2" "3" "4" ... $ effects : Named num [1:11523] ...

Get R Data Mining now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.