isBalanced(object, countOnly, level)
TRUE
or FALSE
according to whether the data are balanced
or notcountOnly
is FALSE
the design is also checked for balance
with respect to the primary covariate, which is often the time of the
observation. A design is balanced with respect to the grouping factor
and the covariate if the number of observations at each distinct level
(or combination of levels for nested factors) is constant and the times
at which the observations are taken (in general, the values of the
primary covariates) also are constant.table
, groupedData
data(Orthodont)
isBalanced(Orthodont) # should return TRUE
isBalanced(Orthodont, countOnly = TRUE) # should return TRUE
data(Pixel)
isBalanced(Pixel) # should return FALSE
isBalanced(Pixel, level = 1) # should return FALSE
Run the code above in your browser using DataLab