

isBalanced(nlme)                             R Documentation

_C_h_e_c_k _a _D_e_s_i_g_n _f_o_r _B_a_l_a_n_c_e

_D_e_s_c_r_i_p_t_i_o_n_:

     Check the design of the experiment or study for bal-
     ance.

_U_s_a_g_e_:

     isBalanced(object, countOnly, level)

_A_r_g_u_m_e_n_t_s_:

  object: A `groupedData' object containing a data frame and
          a formula that describes the roles of variables in
          the data frame.  The object will have one or more
          nested grouping factors and a primary covariate.

countOnly: A logical value indicating if the check for bal-
          ance should only consider the number of observa-
          tions at each level of the grouping factor(s).
          Defaults to `FALSE'.

   level: an optional integer vector specifying the desired
          prediction levels. Levels increase from outermost
          to innermost grouping, with level 0 representing
          the population (fixed effects) predictions.
          Defaults to the innermost level.

_D_e_t_a_i_l_s_:

     A design is balanced with respect to the grouping fac-
     tor(s) if there are the same number of observations at
     each distinct value of the grouping factor or each com-
     bination of distinct levels of the nested grouping fac-
     tors.  If `countOnly' is `FALSE' the design is also
     checked for balance with respect to the primary covari-
     ate, 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 obser-
     vations are taken (in general, the values of the pri-
     mary covariates) also are constant.

_V_a_l_u_e_:

     `TRUE' or `FALSE' according to whether the data are
     balanced or not

_A_u_t_h_o_r_(_s_)_:

     Jose Pinheiro and Douglas Bates

_S_e_e _A_l_s_o_:

     `table', `groupedData'

_E_x_a_m_p_l_e_s_:

     library(nlme)
     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

