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:
- Compute a detailed summary of the fitted model:
> summary(lmfit)
Output:
Call:
lm(formula = y1 ~ x)
Residuals:
Min 1Q Median 3Q Max
-1.92127 -0.45577 -0.04136 0.70941 1.83882
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.0001 1.1247 2.667 0.02573 *
Quartet$x 0.5001 0.1179 4.241 0.00217 **
---
...