Summarizing linear model fits

The summary function can be used to obtain the formatted coefficient, standard errors, degree of freedom, and other summarized information of a fitted model. This recipe introduces how to obtain overall information on a model through the use of the summary function.

Getting ready

You need to have completed the previous recipe by computing the linear model of the x and y1 variables from the quartet, and have the fitted model assigned to the lmfit variable.

How to do it...

Perform the following step to summarize linear model fits:

  1. Compute a detailed summary of the fitted model:
    > summary(lmfit)
    
    Call:
    lm(formula = y1 ~ x)
    
    Residuals:
         Min       1Q   Median       3Q      Max 
    -1.92127 -0.45577 -0.04136  0.70941  1.83882 
    
    Coefficients:
     Estimate ...

Get R: Recipes for Analysis, Visualization and Machine Learning 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.