Learn R Programming

tramME (version 1.0.7)

plot.tramME: Plotting method for tramME objects

Description

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.

Usage

# 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"),
  ...
)

Value

A numeric matrix of the predicted values invisibly.

Arguments

x

A tramME object.

newdata

an optional data frame of observations

ranef

Random effects (either in named list format or a numeric vector) or the word "zero". See Details.

fix_smooth

If FALSE, the random effects coefficients of the smooth terms are refitted to newdata. It's probably not what you want to do.

type

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.

Details

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.

Examples

Run this code
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