EVOLUTION-MANAGER
Edit File: weighted.residuals.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: Compute Weighted Residuals</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 weighted.residuals {stats}"><tr><td>weighted.residuals {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Compute Weighted Residuals</h2> <h3>Description</h3> <p>Computed weighted residuals from a linear model fit. </p> <h3>Usage</h3> <pre> weighted.residuals(obj, drop0 = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>obj</code></td> <td> <p><span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> object, typically of class <code><a href="lm.html">lm</a></code> or <code><a href="glm.html">glm</a></code>.</p> </td></tr> <tr valign="top"><td><code>drop0</code></td> <td> <p>logical. If <code>TRUE</code>, drop all cases with <code><a href="weights.html">weights</a> == 0</code>.</p> </td></tr> </table> <h3>Details</h3> <p>Weighted residuals are based on the deviance residuals, which for a <code><a href="lm.html">lm</a></code> fit are the raw residuals <i>Ri</i> multiplied by <i>wi^0.5</i>, where <i>wi</i> are the <code>weights</code> as specified in <code><a href="lm.html">lm</a></code>'s call. </p> <p>Dropping cases with weights zero is compatible with <code><a href="lm.influence.html">influence</a></code> and related functions. </p> <h3>Value</h3> <p>Numeric vector of length <i>n'</i>, where <i>n'</i> is the number of of non-0 weights (<code>drop0 = TRUE</code>) or the number of observations, otherwise. </p> <h3>See Also</h3> <p><code><a href="residuals.html">residuals</a></code>, <code><a href="lm.influence.html">lm.influence</a></code>, etc.</p> <h3>Examples</h3> <pre> ## following on from example(lm) all.equal(weighted.residuals(lm.D9), residuals(lm.D9)) x <- 1:10 w <- 0:9 y <- rnorm(x) weighted.residuals(lmxy <- lm(y ~ x, weights = w)) weighted.residuals(lmxy, drop0 = FALSE) </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>