simulate.lme {nlme} | R Documentation |
Simulate Results from lme
Models
Description
The model object
is fit to the data. Using
the fitted values of the parameters, nsim
new data vectors from
this model are simulated. Both object
and m2
are fit by
maximum likelihood (ML) and/or by restricted maximum likelihood (REML)
to each of the simulated data vectors.
Usage
## S3 method for class 'lme'
simulate(object, nsim = 1, seed = , m2,
method = c("REML", "ML"), niterEM = c(40, 200), useGen, ...)
Arguments
object |
an object inheriting from class |
m2 |
an |
seed |
an optional integer that is passed to |
method |
an optional character array. If it includes
|
nsim |
an optional positive integer specifying the number of
simulations to perform. Defaults to |
niterEM |
an optional integer vector of length 2 giving the number of
iterations of the EM algorithm to apply when fitting the |
useGen |
an optional logical value. If |
... |
optional additional arguments. None are used. |
Value
an object of class simulate.lme
with components null
and
alt
. Each of these has components ML
and/or REML
which are matrices. An attribute called seed
contains
the seed that was used for the random number generator.
Author(s)
José Pinheiro and Douglas Bates bates@stat.wisc.edu
References
Pinheiro, J.C., and Bates, D.M. (2000) Mixed-Effects Models in S and S-PLUS, Springer.
See Also
Examples
orthSim <-
simulate.lme(list(fixed = distance ~ age, data = Orthodont,
random = ~ 1 | Subject),
nsim = 3, # limited here for speed
m2 = list(random = ~ age | Subject))