simulate.tramME {tramME} | R Documentation |
Utilizes the simulation method of mlt. When the vector of random effects is supplied, the simulation is conditional on it.
## S3 method for class 'tramME' simulate( object, nsim = 1, seed = NULL, newdata = NULL, ranef = NULL, what = c("response", "ranef", "joint"), bysim = TRUE, ... )
object |
A fitted tramME object. |
nsim |
number of samples to generate |
seed |
optional seed for the random number generator |
newdata |
an optional data frame of observations |
ranef |
If NULL, random effects are simulated from their estimated
distribution for each draw in nsim, i.e. the simulation is from the
marginal/joint distribution of the response (and random effects).
Otherwise the simulation is conditional on the supplied random effects.
When |
what |
Defaults to |
bysim |
logical, if |
... |
Additional arguments, passed to |
A simulate.tramME object with the structure defined by the inputs.
data("sleepstudy", package = "lme4") fit <- BoxCoxME(Reaction ~ Days + (Days | Subject), data = sleepstudy) sim <- simulate(fit, nsim = 10, seed = 123)