Plot the conditional distribution evaluated at a grid of possible response values and a set of covariate and random effects values on a specified scale.
# S3 method for tramME
plot(
x,
newdata = model.frame(x),
ranef = NULL,
fix_smooth = TRUE,
type = c("trafo", "distribution", "logdistribution", "survivor", "logsurvivor",
"density", "logdensity", "hazard", "loghazard", "cumhazard", "logcumhazard", "odds",
"logodds", "quantile"),
...
)
A numeric matrix of the predicted values invisibly.
A tramME
object.
an optional data frame of observations
Random effects (either in named list format or a numeric vector) or the word "zero". See Details.
If FALSE
, the random effects coefficients of the smooth
terms are refitted to newdata
. It's probably not what you want to do.
The scale on which the predictions are evaluated:
trafo: The prediction evaluated on the scale of the transformation function.
(log)distribution: The prediction evaluated on the scale of the conditional (log-)CDF.
(log)survivor: The prediction evaluated on the scale of the (conditional) (log-)survivor function.
(log)density: The prediction evaluated on the scale of the conditional (log-)PDF.
(log)hazard: The prediction evaluated on the (log-)hazard scale.
(log)cumhazard: The prediction evaluated on the (log-)cumulative hazard scale.
(log)odds: The prediction evaluated on the (log-)odds scale.
quantile: Return the quantiles of the conditional outcome distribution
corresponding to newdata
. For more information, see Details.
Additional arguments, passed to plot.mlt
.
When ranef
is equal to "zero", a vector of zeros with the right size is
substituted. For more details, see predict.tramME
.
For more information on how to control the grid on which the functions are evaluated,
see the documentation of predict.mlt
.
data("sleepstudy", package = "lme4")
fit <- BoxCoxME(Reaction ~ Days + (Days | Subject), data = sleepstudy)
plot(fit, K = 100, type = "density")
Run the code above in your browser using DataLab