lmer                 package:Matrix                 R Documentation

_F_i_t _l_i_n_e_a_r _m_i_x_e_d-_e_f_f_e_c_t_s _m_o_d_e_l_s

_D_e_s_c_r_i_p_t_i_o_n:

     This generic function fits a linear mixed-effects model with
     nested or crossed grouping factors for the random effects.

_U_s_a_g_e:

     lmer(formula, data, family,
          method = c("REML", "ML", "PQL", "Laplace", "AGQ"),...)

_A_r_g_u_m_e_n_t_s:

 formula: a two-sided linear formula object describing the
          fixed-effects part of the model, with the response on the
          left of a '~' operator and the terms, separated by '+'
          operators, on the right.  The vertical bar character '"|"'
          separates an expression for a model matrix and a grouping
          factor.

    data: an optional data frame containing the variables named in
          'formula'.  By default the variables are taken from the
          environment from which 'lmer' is called.

  family: a GLM family, see 'glm'.  If 'family' is missing then a
          linear mixed model is fit; otherwise a generalized linear
          mixed model is fit.

  method: a character string.  For a linear mixed model the default is
          '"REML"' indicating that the model should be fit by
          maximizing the restricted log-likelihood.  The alternative is
          '"ML"' indicating that the log-likelihood should be
          maximized.  (This method is sometimes called "full" maximum
          likelihood.)  For a generalized linear mixed model the
          criterion is always the log-likelihood but this criterion
          does not have a closed form expression and must be
          approximated.  The default approximation is '"PQL"' or
          penalized quasi-likelihood.  Alternatives are '"Laplace"' or
          '"AGQ"' indicating the Laplacian and adaptive Gaussian
          quadrature approximations respectively.  The '"PQL"' method
          is fastest but least accurate.  The '"Laplace"' method is
          intermediate in speed and accuracy. The '"AGQ"' method is the
          most accurate but can be considerably slower than the others.

     ...: Optional arguments for methods.  Currently none are used.

_D_e_t_a_i_l_s:

     This is a revised version of the 'lme' function from the 'nlme'
     package.  This version uses a different method of specifying
     random-effects terms and allows for fitting generalized linear
     mixed models as well as linear mixed models.

     Additional standard arguments to model-fitting functions can be
     passed to 'lmer'.

     _s_u_b_s_e_t an optional expression indicating the subset of the rows of
          'data' that should be used in the fit. This can be a logical
          vector, or a numeric vector indicating which observation
          numbers are to be included, or a  character  vector of the
          row names to be included.  All observations are included by
          default.

     _n_a._a_c_t_i_o_n a function that indicates what should happen when the
          data contain 'NA's.  The default action ('na.fail') causes
          'lme' to print an error message and terminate if there are
          any incomplete observations.

     _c_o_n_t_r_o_l a named list of control values for the estimation
          algorithm.  Possible control options and their values are:

          _m_a_x_I_t_e_r maximum number of iterations for the 'lme'
               optimization algorithm. Default is 50. 

          _m_s_M_a_x_I_t_e_r maximum number of iterations for the 'nlminb'
               optimization step inside the 'lme' optimization. Default
               is 200.

          _n_i_t_e_r_E_M number of iterations for the EM algorithm used to
               refine the initial estimates of the random effects
               variance-covariance coefficients. Default is 15.

          _m_s_V_e_r_b_o_s_e a logical value passed as the 'trace' argument to
               'nlminb' (see documentation on that function). Default
               is 'getOption("verbose")'. 

          _P_Q_L_m_a_x_I_t maximum number of iterations for the PQL algorithm
               when fitting generalized linear mixed models. Default is
               30.

          _E_M_v_e_r_b_o_s_e a logical value indicating if verbose output should
               be produced during the EM iterations.  Default is
               'getOption("verbose"'. 

          _a_n_a_l_y_t_i_c_G_r_a_d_i_e_n_t a logical value indicating if the analytic
               gradient of the objective should be used.  This option
               is for testing purposes and would not normally be
               changed from the default.  Default is 'TRUE'.

          _a_n_a_l_y_t_i_c_H_e_s_s_i_a_n a logical value indicating if the analytic
               Hessian of the objective should be calculated. This is
               an experimental feature and at present the default is
               'FALSE'. In the future we may use the analytic Hessian
               in the optimization. 

          Defaults to an empty list.

     _m_o_d_e_l, _x logicals.  If 'TRUE' the corresponding components of the
          fit (the model frame, the model matrices) are returned.

_V_a_l_u_e:

     An 'lmer-class{lmer}' object.

_S_e_e _A_l_s_o:

     'lmer-class', 'lm'

_E_x_a_m_p_l_e_s:

     (fm1 <- lmer(decrease ~ treatment + (1|rowpos) + (1|colpos),
                  OrchardSprays))

