EVOLUTION-MANAGER
Edit File: lm.summaries.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Accessing Linear Model Fits</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for lm.summaries {stats}"><tr><td>lm.summaries {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Accessing Linear Model Fits</h2> <h3>Description</h3> <p>All these functions are <code><a href="../../utils/html/methods.html">methods</a></code> for class <code>"lm"</code> objects. </p> <h3>Usage</h3> <pre> ## S3 method for class 'lm' family(object, ...) ## S3 method for class 'lm' formula(x, ...) ## S3 method for class 'lm' residuals(object, type = c("working", "response", "deviance", "pearson", "partial"), ...) ## S3 method for class 'lm' labels(object, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object, x</code></td> <td> <p>an object inheriting from class <code>lm</code>, usually the result of a call to <code><a href="lm.html">lm</a></code> or <code><a href="aov.html">aov</a></code>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments passed to or from other methods.</p> </td></tr> <tr valign="top"><td><code>type</code></td> <td> <p>the type of residuals which should be returned. Can be abbreviated.</p> </td></tr> </table> <h3>Details</h3> <p>The generic accessor functions <code>coef</code>, <code>effects</code>, <code>fitted</code> and <code>residuals</code> can be used to extract various useful features of the value returned by <code>lm</code>. </p> <p>The working and response residuals are ‘observed - fitted’. The deviance and pearson residuals are weighted residuals, scaled by the square root of the weights used in fitting. The partial residuals are a matrix with each column formed by omitting a term from the model. In all these, zero weight cases are never omitted (as opposed to the standardized <code><a href="influence.measures.html">rstudent</a></code> residuals, and the <code><a href="weighted.residuals.html">weighted.residuals</a></code>). </p> <p>How <code>residuals</code> treats cases with missing values in the original fit is determined by the <code>na.action</code> argument of that fit. If <code>na.action = na.omit</code> omitted cases will not appear in the residuals, whereas if <code>na.action = na.exclude</code> they will appear, with residual value <code>NA</code>. See also <code><a href="nafns.html">naresid</a></code>. </p> <p>The <code>"lm"</code> method for generic <code><a href="../../base/html/labels.html">labels</a></code> returns the term labels for estimable terms, that is the names of the terms with an least one estimable coefficient. </p> <h3>References</h3> <p>Chambers, J. M. (1992) <em>Linear models.</em> Chapter 4 of <em>Statistical Models in S</em> eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p>The model fitting function <code><a href="lm.html">lm</a></code>, <code><a href="anova.lm.html">anova.lm</a></code>. </p> <p><code><a href="coef.html">coef</a></code>, <code><a href="deviance.html">deviance</a></code>, <code><a href="df.residual.html">df.residual</a></code>, <code><a href="effects.html">effects</a></code>, <code><a href="fitted.values.html">fitted</a></code>, <code><a href="glm.html">glm</a></code> for <b>generalized</b> linear models, <code><a href="lm.influence.html">influence</a></code> (etc on that page) for regression diagnostics, <code><a href="weighted.residuals.html">weighted.residuals</a></code>, <code><a href="residuals.html">residuals</a></code>, <code><a href="glm.summaries.html">residuals.glm</a></code>, <code><a href="summary.lm.html">summary.lm</a></code>, <code><a href="weights.html">weights</a></code>. </p> <p><a href="influence.measures.html">influence.measures</a> for deletion diagnostics, including standardized (<code><a href="influence.measures.html">rstandard</a></code>) and studentized (<code><a href="influence.measures.html">rstudent</a></code>) residuals. </p> <h3>Examples</h3> <pre> ##-- Continuing the lm(.) example: coef(lm.D90) # the bare coefficients ## The 2 basic regression diagnostic plots [plot.lm(.) is preferred] plot(resid(lm.D90), fitted(lm.D90)) # Tukey-Anscombe's abline(h = 0, lty = 2, col = "gray") qqnorm(residuals(lm.D90)) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>