EVOLUTION-MANAGER
Edit File: balancedGrouped.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: Create a groupedData object from a matrix</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 balancedGrouped {nlme}"><tr><td>balancedGrouped {nlme}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create a groupedData object from a matrix</h2> <h3>Description</h3> <p>Create a <code>groupedData</code> object from a data matrix. This function can be used only with balanced data. The opposite conversion, from a <code>groupedData</code> object to a <code>matrix</code>, is done with <code>asTable</code>. </p> <h3>Usage</h3> <pre> balancedGrouped(form, data, labels=NULL, units=NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>form</code></td> <td> <p>A formula of the form <code>y ~ x | g</code> giving the name of the response, the primary covariate, and the grouping factor.</p> </td></tr> <tr valign="top"><td><code>data</code></td> <td> <p>A matrix or data frame containing the values of the response grouped according to the levels of the grouping factor (rows) and the distinct levels of the primary covariate (columns). The <code>dimnames</code> of the matrix are used to construct the levels of the grouping factor and the primary covariate.</p> </td></tr> <tr valign="top"><td><code>labels</code></td> <td> <p>an optional list of character strings giving labels for the response and the primary covariate. The label for the primary covariate is named <code>x</code> and that for the response is named <code>y</code>. Either label can be omitted.</p> </td></tr> <tr valign="top"><td><code>units</code></td> <td> <p>an optional list of character strings giving the units for the response and the primary covariate. The units string for the primary covariate is named <code>x</code> and that for the response is named <code>y</code>. Either units string can be omitted.</p> </td></tr> </table> <h3>Value</h3> <p>A balanced <code>groupedData</code> object. </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>Pinheiro, J. C. and Bates, D. M. (2000), <em>Mixed-Effects Models in S and S-PLUS</em>, Springer, New York. </p> <h3>See Also</h3> <p><code><a href="groupedData.html">groupedData</a></code>, <code><a href="isBalanced.html">isBalanced</a></code>, <code><a href="asTable.html">asTable</a></code></p> <h3>Examples</h3> <pre> OrthoMat <- asTable( Orthodont ) Orth2 <- balancedGrouped(distance ~ age | Subject, data = OrthoMat, labels = list(x = "Age", y = "Distance from pituitary to pterygomaxillary fissure"), units = list(x = "(yr)", y = "(mm)")) Orth2[ 1:10, ] ## check the first few entries # Pinheiro and Bates, p. 109 ergoStool.mat <- asTable(ergoStool) balancedGrouped(effort~Type|Subject, data=ergoStool.mat) </pre> <hr /><div style="text-align: center;">[Package <em>nlme</em> version 3.1-139 <a href="00Index.html">Index</a>]</div> </body></html>