O'Reilly logo

Regression Analysis with R by Giuseppe Ciaburro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exploring model results

We previously said that the lm() function creates a LinearModel object, comprising used data, model description, diagnostic information, and fitted coefficients for a linear regression. Now, we will use some of these properties to extract further knowledge from the model.

The values in the lm object depend on the type of model we have built. In this regard, it should be noted that the lm() function can be used to carry out regression, single stratum analysis of variance, and analysis of covariance. To see exactly what a linear model fit produces, try the names function:

names(LModel)

For LModel, the result are shown as follows:

> names(LModel) [1] "coefficients" "residuals" "effects" "rank" "fitted.values" "assign" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required