EVOLUTION-MANAGER
Edit File: fitted.lme.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: Extract lme Fitted 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 fitted.lme {nlme}"><tr><td>fitted.lme {nlme}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Extract lme Fitted Values</h2> <h3>Description</h3> <p>The fitted values at level <i>i</i> are obtained by adding together the population fitted values (based only on the fixed effects estimates) and the estimated contributions of the random effects to the fitted values at grouping levels less or equal to <i>i</i>. The resulting values estimate the best linear unbiased predictions (BLUPs) at level <i>i</i>. </p> <h3>Usage</h3> <pre> ## S3 method for class 'lme' fitted(object, level, asList, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>an object inheriting from class <code>"<a href="lme.html">lme</a>"</code>, representing a fitted linear mixed-effects model.</p> </td></tr> <tr valign="top"><td><code>level</code></td> <td> <p>an optional integer vector giving the level(s) of grouping to be used in extracting the fitted values from <code>object</code>. Level values increase from outermost to innermost grouping, with level zero corresponding to the population fitted values. Defaults to the highest or innermost level of grouping.</p> </td></tr> <tr valign="top"><td><code>asList</code></td> <td> <p>an optional logical value. If <code>TRUE</code> and a single value is given in <code>level</code>, the returned object is a list with the fitted values split by groups; else the returned value is either a vector or a data frame, according to the length of <code>level</code>. Defaults to <code>FALSE</code>.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>some methods for this generic require additional arguments. None are used in this method.</p> </td></tr> </table> <h3>Value</h3> <p>If a single level of grouping is specified in <code>level</code>, the returned value is either a list with the fitted values split by groups (<code>asList = TRUE</code>) or a vector with the fitted values (<code>asList = FALSE</code>); else, when multiple grouping levels are specified in <code>level</code>, the returned object is a data frame with columns given by the fitted values at different levels and the grouping factors. For a vector or data frame result the <code><a href="../../stats/html/nafns.html">napredict</a></code> method is applied. </p> <h3>Author(s)</h3> <p>José Pinheiro and Douglas Bates <a href="mailto:bates@stat.wisc.edu">bates@stat.wisc.edu</a></p> <h3>References</h3> <p>Bates, D.M. and Pinheiro, J.C. (1998) "Computational methods for multilevel models" available in PostScript or PDF formats at http://nlme.stat.wisc.edu/pub/NLME/ </p> <p>Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer, esp. pp. 235, 397. </p> <h3>See Also</h3> <p><code><a href="lme.html">lme</a></code>, <code><a href="residuals.lme.html">residuals.lme</a></code> </p> <h3>Examples</h3> <pre> fm1 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) fitted(fm1, level = 0:1) </pre> <hr /><div style="text-align: center;">[Package <em>nlme</em> version 3.1-139 <a href="00Index.html">Index</a>]</div> </body></html>