

comparePred(nlme)                            R Documentation

_C_o_m_p_a_r_e _P_r_e_d_i_c_t_i_o_n_s

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

     Predicted values are obtained at the specified values
     of `primary' for each object. If either `object1' or
     `object2' have a grouping structure (i.e. `get-
     Groups(object)' is not `NULL'), predicted values are
     obtained for each group. When both objects determine
     groups, the group levels must be the same. If other
     covariates besides `primary' are used in the prediction
     model, their group-wise averages (numeric covariates)
     or most frequent values (categorical covariates) are
     used to obtain the predicted values. The original
     observations are also included in the returned object.

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

     comparePred(object1, object2, primary, minimum, maximum, length.out,
     level, ...)

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

object1,object2: fitted model objects, from which predic-
          tions can be extracted using the `predict' method.

 primary: an optional one-sided formula specifying the pri-
          mary covariate to be used to generate the aug-
          mented predictions. By default, if a  covariate
          can be extracted from the data used to generate
          the objects (using `getCovariate'), it will be
          used as `primary'.

 minimum: an optional lower limit for the primary covariate.
          Defaults to `min(primary)'.

 maximum: an optional upper limit for the primary covariate.
          Defaults to `max(primary)'.

length.out: an optional integer with the number of primary
          covariate values at which to evaluate the predic-
          tions. Defaults to 51.

   level: an optional integer specifying the desired predic-
          tion level. Levels increase from outermost to
          innermost grouping, with level 0 representing the
          population (fixed effects) predictions. Only one
          level can be specified. Defaults to the innermost
          level.

     ...: some methods for the generic may require addi-
          tional arguments.

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

     a data frame with four columns representing, respec-
     tively, the values of the primary covariate, the groups
     (if `object' does not have a grouping structure, all
     elements will be `1'), the predicted or observed val-
     ues, and the type of value in the third column: the
     objects' names are used to classify the predicted val-
     ues and `original' is used for the observed values. The
     returned object inherits from classes `comparePred' and
     `augPred'.

_N_o_t_e_:

     This function is generic; method functions can be writ-
     ten to handle specific classes of objects. Classes
     which already have methods for this function include:
     `gls', `lme', and `lmList'.

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

     Jose Pinheiro and Douglas Bates

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

     `augPred', `getGroups'

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

     library(nlme)
     data(Orthodont)
     fm1 <- lme(distance ~ age * Sex, data = Orthodont, random = ~ age)
     fm2 <- update(fm1, distance ~ age)
     comparePred(fm1, fm2, length.out = 2)

