lmer-class               package:lme4               R Documentation

_M_i_x_e_d _M_o_d_e_l _R_e_p_r_e_s_e_n_t_a_t_i_o_n_s _a_n_d *_m_e_r _M_e_t_h_o_d_s

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

     The 'mer' class is mixed-effects representation using a sparse,
     symmetric, column-oriented matrix and several dense matrices.  The
     'lmer' class extends 'mer' to represent a fitted linear
     mixed-effects model.  The 'summary.mer' and 'summary.lmer' classes
     represent summaries of these objects.  The 'coef.lmer' and
     'ranef.lmer' classes represent fixed and random effect
     "coefficients".

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

     ## S4 method for signature 'mer':
     logLik(object, REML = object@status["REML"], ...)
     ## S4 method for signature 'mer':
     vcov(object, REML = object@status["REML"], ...)

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

  object: object of class 'mer' or 'lmer'.

    REML: logical indicating if REML should be used.

     ...: potential further arguments passed to methods.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls of the form 'new("lmer", ...)' or,
     more commonly via the 'lmer' function.

_S_l_o_t_s:

     '_f_l_i_s_t': The list of grouping factors for the random effects.

     '_Z_t': The transpose of the model matrix for the random effects
          stored as a '"dgCMatrix"'.

     '_X': Model matrix for the fixed effects.

     '_y': Numeric response vector.

     '_w_t_s': Numeric weights vector.

     '_w_r_k_r_e_s': Numeric vector of working residuals.

     '_m_e_t_h_o_d': Character vector of length 1 containing '"ML"', for
          maximum likelihood, or '"REML"', for restricted maximum
          likelihood, or '"PQL"', for penalized quasi-likelihood, or
          '"Laplace"', for the Laplacian approximation, or '"AGQ"', for
          adaptive Gauss-Hermite quadrature.

     '_f_a_m_i_l_y': a copy of the glm family.

     '_c_a_l_l': a copy of the call to the model-fitting function.

     '_c_n_a_m_e_s': a list of character vectors of column names of the
          random-effects variance-covariance matrix associated with
          each grouping factor and the fixed-effects model matrix.

     '_n_c': integer vector giving the number of columns the
          variance-covariance matrix associated with each grouping
          factor.

     '_G_p': integer vector of group pointers within the random effects
          and the rows of the transposed model matrix in the 'Zt' slot.
           The elements of 'Gp' are the 0-based index of the first
          element corresponding to each grouping factor.  Thus the
          first element is always 0.  The last element is the total
          length of the random effects vector (also the total number of
          rows in the matrix in the 'Zt' slot).

     '_X_t_X': The crossproduct matrix of the model matrix in the 'X'
          slot, stored as a '"dpoMatrix"' object.

     '_Z_t_Z': The crossproduct matrix of the model matrix for the random
          effects, stored as a '"dpoMatrix"' object.

     '_Z_t_X': The original Z'X matrix, stored as a '"dgeMatrix"' object.

     '_Z_t_y': The numeric vector Z'y.

     '_X_t_y': The numeric vector X'y.

     '_O_m_e_g_a': A list of positive-definite matrices stored as
          '"dpoMatrix"' objects that are the relative precision
          matrices of the random effects associated with each of the
          grouping factors.

     '_L': The sparse, supernodal lower Cholesky factor of Z'Z+Omega,
          stored as a '"dCHMsuper"' object.

     '_R_Z_X': A rectangular matrix, stored as a '"dgeMatrix"' object,
          which is the RZX component of the Cholesky factor of
          Z'Z+Omega at the current values of the parameters.

     '_R_X_X': An upper triangular matrix, stored as a '"dtrMatrix"'
          object, which is the RXX component of the Cholesky factor of
          Z'Z+Omega at the current values of the parameters.

     '_r_Z_y': A numeric vector - the rZy component of the Cholesky factor
          of Z'Z+Omega at the current values of the parameters.

     '_r_X_y': A numeric vector - the rXy component of the Cholesky factor
          of Z'Z+Omega at the current values of the parameters.

     '_d_e_v_C_o_m_p': Numeric vector of components from which the deviance
          can be calculated.  The named components are: '"n"', the
          number of observations (length of the '"y"' slot), '"p"', the
          length of the fixed-effects vector (number of columns of the
          matrix in the '"X"' slot), '"yty"', the sum of squares of the
          'y','"logryy2"', the logarithm of the penalized residual sum
          of squares, '"logDetL2"', the logarithm of the square of the
          determinant of 'L', '"logDetOmega"', the logarithm of the
          determinant of 'Omega', and '"logDetRXX"', the logarithm of
          the determinant of the triangular matrix in the '"RXX"' slot.
          This slot's contents are current if 'status$stage > 0'.

     '_d_e_v_i_a_n_c_e': Numeric vector of length 2 containing the deviance
          corresponding to the maximum likelihood (ML) and REML
          criteria.  This slot's contents are current if 'status$stage
          > 0factored'.

     '_f_i_x_e_f': Numeric vector containing the conditional estimates of
          the fixed effects.  This slot's contents are current if
          'status$stage > 1'.

     '_r_a_n_e_f': Numeric vector containing the conditional modes of the
          random effects.  This slot's contents are current if
          'status$stage > 1'.

     '_R_Z_X_i_n_v': A rectangular matrix, stored as a '"dgeMatrix"' object,
          which is the RZX component of the inverse of the Cholesky
          factor of Z'Z+Omega at the current values of the parameters.
          This slot's contents are current if 'status$stage > 2'.

     '_b_V_a_r': A list of the diagonal inner blocks (upper triangles only)
          of the positive-definite matrices on the diagonal of the
          inverse of 'ZtZ+Omega'. With the appropriate scale factor
          (and conversion to a symmetric matrix) these are the
          conditional variance-covariance matrices of the random
          effects.

     '_g_r_a_d_C_o_m_p': A list of three-dimensional arrays each with four
          faces.  See the code for the documentation of these
          components.

     '_s_t_a_t_u_s': Integer vector of length 4 indicating the stage of the
          calculation at the current value of 'Omega', and whether REML
          is being used.  The codes for the '"stage"' element are 0 -
          unfactored, 1 - factored, 2 - secondary, 3 - gradComp and 4 -
          HessComp.

     '_c_a_l_l': A copy of the matched call to the function that created
          the object.

     '_f_r_a_m_e': the model frame for the model or an empty data frame

     '_t_e_r_m_s': the terms attribute of the model frame for the
          fixed-effects terms only

     '_w_e_i_g_h_t_s': prior weights on the responses.  Only present in the
          'glmer' class.

     '_s_h_o_w_C_o_r_r_e_l_a_t_i_o_n': Logical indicator of whether to display the
          correlation of the fixed-effects estimates when showing the
          object. Only present in the 'summary.lmer' class.

     The '"summary.mer"', '"summary.lmer"' and '"summary.glmer"'
     classes _contain_ the '"mer"', '"lmer"' and '"glmer"' classes
     respectively and have additional slots,

     '_i_s_G': logical indicating if we have a *g*eneralized linear mixed
          effects model.

     '_m_e_t_h_T_i_t_l_e': character string specifying a method title

     '_l_o_g_L_i_k': the same as 'logLik(object)'.

     '_n_g_r_p_s': ...

     '_s_i_g_m_a': the scale ...

     '_c_o_e_f_s': the coefficients matrix...

     '_v_c_o_v': the same as 'vcov(object)'.

     '_R_E_m_a_t': the formatted Random-Effects matrix

     '_A_I_C_t_a_b': ...

_M_e_t_h_o_d_s:

     _a_n_o_v_a 'signature(object = "mer")': model comparisons for 'mer'
          objects, see 'anova'.

     _c_o_e_f 'signature(object = "lmer")': Extract the parameters that
          determine the Omega matrices.  The optional logical argument
          'unconstr' determines the constrained or unconstrained
          parameterization.

     _c_o_e_f<- 'signature(object = "lmer", value = "numeric")': Assign the
          parameters that determine the Omega matrices.  The optional
          logical argument 'unconstr' determines the constrained or
          unconstrained parameterization. 

     _c_o_e_r_c_e 'signature(from = "lmer", to = "dtTMatrix")': Ensure that
          the 'lmer' object has been factored but not inverted and
          extract the unit lower triangular matrix L from the LDL
          decomposition of crossprod(Z)+Omega.

     _c_o_e_r_c_e 'signature(from = "lmer", to = "dsTMatrix")': Ensure that
          the 'lmer' object has been factored but not inverted and
          extract the symmetric matrix crossprod(Z)+Omega.

     _d_e_v_i_a_n_c_e 'signature(object = "mer")': extracts the 'deviance' of
          the fitted model.

     _l_o_g_L_i_k 'signature(object = "mer")': Extract the log-likelihood
          from of the fitted model, see also 'logLik'.

     _u_p_d_a_t_e 'signature(object = "mer")': see 'update' on how to update
          fitted models.

     _s_i_m_u_l_a_t_e 'signature(object = "mer")': see 'simulate' on how to
          simulate from fitted models.

     _s_o_l_v_e 'signature(a = "lmer", b = "missing")': Invert the
          decomposed matrices.

     _t_e_r_m_s 'signature(x = "lmer")': Extract 'terms' component.

     _v_c_o_v 'signature(object = "mer")': Calculate variance-covariance
          matrix of the _fixed_ effect terms, see also 'vcov'.

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

     'lmer()' produces these objects. 
      'VarCorr' for extracting the variance and correlation components
     of the _random_-effects terms.

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

     (fm2 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject),
                  data = sleepstudy))
     print(fm2, digits = 10, corr = FALSE) # more precision; no corr.matrix

     logLik(fm2)
     (V2 <- vcov(fm2))
     str(resid(fm2))

     ## Simulate 'Reaction' according to the fitted model:
     dim(ss <- simulate(fm2, nsim = 200, seed = 101)) ## -> 180 x 200

