Usage
## S3 method for class 'merMod':
simulate(object, nsim = 1, seed = NULL,
use.u = FALSE, re.form=NA, ReForm, REForm, REform,
newdata=NULL, newparams=NULL,
family=NULL,
allow.new.levels=FALSE, na.action=na.pass, \dots)
## S3 method for class 'formula':
simulate(object, nsim = 1 , seed = NULL, family, weights=NULL, offset=NULL, \dots)
.simulateFun(object, nsim = 1, seed = NULL, use.u = FALSE,
re.form=NA, ReForm, REForm, REform,
newdata=NULL, newparams=NULL,
formula=NULL,family=NULL,
weights=NULL, offset=NULL,
allow.new.levels=FALSE, na.action=na.pass, ...)
Arguments
object
(for simulate.merMod
) a fitted model object or
(for simulate.formula
) a (one-sided) mixed model
formula, as described for lmer
formula
a (one-sided) mixed model
formula, as described for lmer
nsim
positive integer scalar - the number of
responses to simulate
seed
an optional seed to be used in
set.seed
immediately before the simulation so as
to generate a reproducible sample.
use.u
(logical) if TRUE
, generate a
simulation conditional on the current random-effects
estimates; if FALSE
generate new Normally
distributed random-effects values. (Redundant with re.form
,
which is prefer
re.form
formula for random effects to condition on. If NULL
,
include all random effects; if NA
or ~0
,
include no random effects.
ReForm
allowed for backward compatibility: re.form
is
now the preferred argument name
REForm
allowed for backward compatibility: re.form
is
now the preferred argument name
REform
allowed for backward compatibility: re.form
is
now the preferred argument name
newdata
data frame for which to evaluate
predictions
newparams
new parameters to use in evaluating predictions,
specified as in the start
parameter for lmer
or glmer
-- a list with components theta<
family
a GLM family, as in glmer
allow.new.levels
(logical) if FALSE (default),
then any new levels (or NA values) detected in
newdata
will trigger an error; if TRUE, then the
prediction will use the unconditional (population-level)
values for data with previously unobserved
na.action
what to do with NA
values in new data:
see na.fail
...
optional additional arguments: none are used at present