Summary Method for Linear Models

DESCRIPTION:

Returns a summary list for a linear model.

USAGE:

summary.lm(object, correlation=FALSE)

REQUIRED ARGUMENTS:

object
the fitted model. This is assumed to be the result of some fit that produces an object inheriting from the class "lm". The components returned by the lm function must be available in object.

OPTIONAL ARGUMENTS:

correlation
logical flag. If TRUE, the correlation matrix for the coefficients is included in the summary.

VALUE:

a list is returned with the following components:
correlation
the computed correlation matrix for the coefficients in the model. This is only returned if correlation=TRUE was set.
cov.unscaled
the unscaled covariance matrix. Multiplying cov.unscaled by an estimate of the error variance produces an estimated covariance matrix for the coefficients.
df
a numeric vector of length three giving the rank of the model matrix, the residual degrees of freedom, and the number of coefficients for the model.
coefficients
a matrix with four columns, containing the coefficients and their corresponding standard errors, t-statistics, and p-values.
r.squared
the multiple R-squared statistic for the model.
adj.r.squared
the adjusted multiple R-squared statistic for the model.
fstatistic
a numeric vector of length three giving the F-test for the regression. The first element in the vector is the statistic, and the last two elements are the degrees of freedom.
residuals
the residuals for the model. These are the weighted residuals if weights were given in the model.
sigma
the residual standard error estimate.
terms
the terms object used in fitting the model.
call
an image of the call that produced object, but with the arguments all named and with the actual formula included as the formula argument.

DETAILS:

This function is a method for the generic function summary for the class "lm". It can be invoked by calling summary with an object of the appropriate class. Alternatively, it can be invoked directly by calling summary.lm regardless of the class of the object.

SEE ALSO:

, , .

EXAMPLES:

summary(lm(stack.loss ~ stack.x[,1]), cor=T)
# Produces the following output:
#
# Call: lm(formula = stack.loss ~ stack.x[, 1])
# Residuals:
#     Min     1Q   Median    3Q   Max
#  -12.29 -1.127 -0.04592 1.117 8.873
#
# Coefficients:
#                 Value Std. Error  t value Pr(>|t|)
# (Intercept)  -44.1320   6.1059    -7.2278   0.0000
# stack.x[, 1]   1.0203   0.1000    10.2079   0.0000
#
# Residual standard error: 4.098 on 19 degrees of freedom
# Multiple R-Squared: 0.8458     Adjusted R-squared: 0.8377
# F-statistic: 104.2 on 1 and 19 degrees of freedom,
#     the p-value is 3.774e-009
#
# Correlation of Coefficients:
#             (Intercept)
# stack.x[, 1] -0.9892