Rev 6562 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File nlme/man/isBalanced.Rd% Part of the nlme package for R% Distributed under GPL 2 or later: see nlme/LICENCE.note\name{isBalanced}\alias{isBalanced}\alias{isBalanced.groupedData}%- Also NEED an `\alias' for EACH other topic documented here.\title{Check a Design for Balance}\usage{isBalanced(object, countOnly, level)}\arguments{\item{object}{A \code{groupedData} object containing a data frame and aformula that describes the roles of variables in the data frame. Theobject will have one or more nested grouping factors and a primarycovariate.}\item{countOnly}{A logical value indicating if the check for balanceshould only consider the number of observations at each level of thegrouping factor(s). Defaults to \code{FALSE}.}\item{level}{an optional integer vector specifying the desiredprediction levels. Levels increase from outermost to innermostgrouping, with level 0 representing the population (fixed effects)predictions. Defaults to the innermost level.}}\description{Check the design of the experiment or study for balance.}\details{A design isbalanced with respect to the grouping factor(s) if there are the samenumber of observations at each distinct value of the grouping factor oreach combination of distinct levels of the nested grouping factors. If\code{countOnly} is \code{FALSE} the design is also checked for balancewith respect to the primary covariate, which is often the time of theobservation. A design is balanced with respect to the grouping factorand the covariate if the number of observations at each distinct level(or combination of levels for nested factors) is constant and the timesat which the observations are taken (in general, the values of theprimary covariates) also are constant.}\value{\code{TRUE} or \code{FALSE} according to whether the data are balancedor not}\author{José Pinheiro and Douglas Bates \email{bates@stat.wisc.edu}}\seealso{\code{\link{table}}, \code{\link{groupedData}}}\examples{isBalanced(Orthodont) # should return TRUEisBalanced(Orthodont, countOnly = TRUE) # should return TRUEisBalanced(Pixel) # should return FALSEisBalanced(Pixel, level = 1) # should return FALSE}\keyword{data}