predict.nlme              package:nlme              R Documentation

_P_r_e_d_i_c_t_i_o_n_s _f_r_o_m _a_n _n_l_m_e _O_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     The predictions at level i are obtained by adding together the
     contributions from the estimated fixed effects and the estimated
     random effects at levels less or equal to i and evaluating the
     model function at the resulting estimated parameters. If group
     values not included in the original grouping factors  are present
     in 'newdata', the corresponding predictions will be  set to 'NA'
     for levels greater or equal to the level at which the  unknown
     groups occur.

_U_s_a_g_e:

     ## S3 method for class 'nlme':
     predict(object, newdata, level, asList, na.action,
     naPattern, ...)

_A_r_g_u_m_e_n_t_s:

  object: an object inheriting from class 'nlme', representing a fitted
          nonlinear mixed-effects model.

 newdata: an optional data frame to be used for obtaining the
          predictions. All variables used in the nonlinear model, the
          fixed and the random effects models, as well as the grouping
          factors, must be present in the data frame. If missing, the
          fitted values are returned.

   level: an optional integer vector giving the level(s) of grouping to
          be used in obtaining the predictions. Level values increase
          from outermost to innermost grouping, with level zero
          corresponding to the population predictions. Defaults to the
          highest or innermost level of grouping.

  asList: an optional logical value. If 'TRUE' and a single value is
          given in 'level', the returned object is a list with the
          predictions split by groups; else the returned value is
          either a vector or a data frame, according to the length of
          'level'. 

na.action: a function that indicates what should happen when 'newdata'
          contains 'NA's.  The default action ('na.fail') causes the
          function to print an error message and terminate if there are
          any incomplete observations.

naPattern: an expression or formula object, specifying which returned
          values are to be regarded as missing.

     ...: some methods for this generic require additional arguments. 
          None are used in this method.

_V_a_l_u_e:

     if a single level of grouping is specified in 'level', the
     returned value is either a list with the predictions split by
     groups ('asList = TRUE') or a vector with the predictions ('asList
     = FALSE'); else, when multiple grouping levels are specified in
     'level', the returned object is a data frame with columns given by
     the predictions at different levels and the grouping factors.

_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:

     'nlme', 'fitted.lme'

_E_x_a_m_p_l_e_s:

     fm1 <- nlme(height ~ SSasymp(age, Asym, R0, lrc),
                 data = Loblolly,
                 fixed = Asym + R0 + lrc ~ 1,
                 random = Asym ~ 1,
                 start = c(Asym = 103, R0 = -8.5, lrc = -3.3))
     newLoblolly <- data.frame(age = c(5,10,15,20,25,30),
                         Seed = rep(301,6))
     predict(fm1, newLoblolly, level = 0:1)

