simulate.lme              package:nlme              R Documentation

_s_i_m_u_l_a_t_e _l_m_e _m_o_d_e_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     The model 'm1' is fit to the data.  Using the fitted values of the
     parameters, 'nsim' new data vectors from this model are simulated.
      Both 'm1' and 'm2' are fit by maximum likelihood (ML) and/or by
     restricted maximum likelihood (REML) to each of the simulated data
     vectors.

_U_s_a_g_e:

     simulate.lme(m1, m2, Random.seed, method, nsim, niterEM, useGen)

_A_r_g_u_m_e_n_t_s:

      m1: an object inheriting from class 'lme', representing a fitted
          linear mixed-effects model, or a list containing an lme model
          specification.  If given as a list, it should contain
          components 'fixed', 'data', and 'random' with values suitable
          for a call to 'lme'. This argument defines the null model. 

      m2: an 'lme' object, or a list, like 'm1' containing a second lme
          model specification. This argument defines the alternative
          model. If given as a list, only those parts of the
          specification that change between model 'm1' and 'm2' need to
          be specified. 

Random.seed: an optional vector to seed the random number generator so
          as to reproduce a simulation.  This vector should be the same
          form as the '.Random.seed' object. 

  method: an optional character array.  If it includes '"REML"' the
          models are fit by maximizing the restricted log-likelihood.
          If it includes '"ML"' the log-likelihood is maximized. 
          Defaults to 'c("REML", "ML")', in which case both methods are
          used. 

    nsim: an optional positive integer specifying the number of
          simulations to perform.  Defaults to 1000. 

 niterEM: an optional integer vector of length 2 giving the number of
          iterations of the EM algorithm to apply when fitting the 'm1'
          and 'm2' to each simulated set of data. Defaults to
          'c(40,200)'.  

  useGen: an optional logical value. If 'TRUE', numerical derivatives
          are used to obtain the gradient and the Hessian of the
          log-likelihood in the optimization algorithm in the 'ms'
          function. If 'FALSE', the default algorithm in 'ms' for
          functions that do not incorporate gradient and Hessian
          attributes is used. Default depends on the 'pdMat' classes
          used in 'm1' and 'm2': if both are standard classes (see
          'pdClasses') then defaults to 'TRUE', otherwise defaults to
          'FALSE'. 

_V_a_l_u_e:

     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 'Random.seed' contains the seed
     that was used for the random number generator.

_A_u_t_h_o_r(_s):

     Jose Pinheiro Jose.Pinheiro@pharma.novartis.com and Douglas Bates
     bates@stat.wisc.edu

_S_e_e _A_l_s_o:

     'lme'

_E_x_a_m_p_l_e_s:

     data(Orthodont)
     ## Not run: 
     orthSim <-
      simulate.lme(m1 = list(fixed = distance ~ age, data = Orthodont,
                             random = ~ 1 | Subject),
                   m2 = list(random = ~ age | Subject))
     ## End(Not run)

