EVOLUTION-MANAGER
Edit File: nafns.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: Adjust for Missing Values</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 naresid {stats}"><tr><td>naresid {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Adjust for Missing Values </h2> <h3>Description</h3> <p>Use missing value information to adjust residuals and predictions. </p> <h3>Usage</h3> <pre> naresid(omit, x, ...) napredict(omit, x, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>omit</code></td> <td> <p>an object produced by an <code><a href="na.action.html">na.action</a></code> function, typically the <code>"na.action"</code> attribute of the result of <code><a href="na.fail.html">na.omit</a></code> or <code><a href="na.fail.html">na.exclude</a></code>.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>a vector, data frame, or matrix to be adjusted based upon the missing value information.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments passed to or from other methods.</p> </td></tr> </table> <h3>Details</h3> <p>These are utility functions used to allow <code><a href="predict.html">predict</a></code>, <code><a href="fitted.values.html">fitted</a></code> and <code><a href="residuals.html">residuals</a></code> methods for modelling functions to compensate for the removal of <code>NA</code>s in the fitting process. They are used by the default, <code>"lm"</code>, <code>"glm"</code> and <code>"nls"</code> methods, and by further methods in packages <a href="https://CRAN.R-project.org/package=MASS"><span class="pkg">MASS</span></a>, <a href="https://CRAN.R-project.org/package=rpart"><span class="pkg">rpart</span></a> and <a href="https://CRAN.R-project.org/package=survival"><span class="pkg">survival</span></a>. Also used for the scores returned by <code><a href="factanal.html">factanal</a></code>, <code><a href="prcomp.html">prcomp</a></code> and <code><a href="princomp.html">princomp</a></code>. </p> <p>The default methods do nothing. The default method for the <code>na.exclude</code> action is to pad the object with <code>NA</code>s in the correct positions to have the same number of rows as the original data frame. </p> <p>Currently <code>naresid</code> and <code>napredict</code> are identical, but future methods need not be. <code>naresid</code> is used for residuals, and <code>napredict</code> for fitted values, predictions and <code><a href="weights.html">weights</a></code>. </p> <h3>Value</h3> <p>These return a similar object to <code>x</code>. </p> <h3>Note</h3> <p>In the early 2000s, packages <a href="https://CRAN.R-project.org/package=rpart"><span class="pkg">rpart</span></a> and <span class="pkg">survival5</span> contained versions of these functions that had an <code>na.omit</code> action equivalent to that now used for <code>na.exclude</code>. </p> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>