primary
for each object. If either object1
or
object2
have a grouping structure
(i.e. getGroups(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.comparePred(object1, object2, primary, minimum, maximum,
length.out, level, ...)
predict
method.getCovariate
), it will bemin(primary)
, after primary
is
evaluated in the data
used in fitting object1
.max(primary)
, after primary
is
evaluated in the data
used in fitting object1
.object
does not have a
grouping structure, all elements will be 1
), the predicted or
observed values, and the type of value in the third column: the
objects' names are used to classify the predicted values and
original
is used for the observed values. The returned object
inherits from classes comparePred
and augPred
.augPred
, getGroups
fm1 <- lme(distance ~ age * Sex, data = Orthodont, random = ~ age)
fm2 <- update(fm1, distance ~ age)
comparePred(fm1, fm2, length.out = 2)
Run the code above in your browser using DataLab