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 model information by using the summary
function.
Getting ready
You need to have completed the previous recipe by fitting the house rental data into a regression model, and have the fitted model assigned to the variable lmfit
.
How to do it…
Perform the following steps to summarize the linear regression model:
- Compute a detailed summary of the fitted model,
lmfit
:> summary(lmfit) Call: lm(formula = Price ~ Sqft, data = house) Residuals: Min 1Q Median 3Q Max -76819 -12388 -3093 10024 112227 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3425.133 1766.646 1.939 0.053 . Sqft 38.334 1.034 37.090 <2e-16 *** Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05...