predict.tramME {tramME} | R Documentation |
Evaluates the _conditional_ distribution implied by a tramME model, given by a
set of covariates and random effects on a desired scale.
When newdata
contains values of the response variable, prediction is only
done for those values. When no response values are supplied, prediction is done on
a grid of values.
Unfitted tramME models can also be used for prediction as long as the coefficent
parameter are set manually (with coef<-
).
## S3 method for class 'tramME' predict(object, newdata = NULL, ranef = NULL, ...)
object |
A tramME object |
newdata |
an optional data frame of observations |
ranef |
Vector of random effects or the word "zero". See details. |
... |
Additional arguments, passed to |
When ranef
is equal to "zero", a vector of zeros with the right size is
substituted.
A numeric matrix of the predicted values invisibly
data("sleepstudy", package = "lme4") fit <- BoxCoxME(Reaction ~ Days + (Days | Subject), data = sleepstudy) predict(fit, type = "trafo") ## evaluate on the transformation function scale nd <- sleepstudy nd$Reaction <- NULL pr <- predict(fit, newdata = nd, ranef = ranef(fit, raw = TRUE), type = "distribution", K = 100)