glmm                package:repeated                R Documentation

_G_e_n_e_r_a_l_i_z_e_d _L_i_n_e_a_r _M_i_x_e_d _M_o_d_e_l_s

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

     'glmm' fits a generalized linear mixed model with a random
     intercept using a normal mixing distribution computed by
     Gauss-Hermite integration. For the normal, gamma, and inverse
     Gaussian distributions, the deviances supplied are -2 log
     likelihood, not the usual 'glm' deviance; the degrees of freedom
     take into account estimation of the dispersion parameter.

     If weights and/or offset are to be used or the formula transforms
     some variables, all of the data must be supplied in a dataframe.
     Because the 'glm' function is such a hack, if this is not done,
     weird error messages will result.

     na.omit is not allowed.

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

     glmm(formula, family=gaussian, data=list(), weights=NULL,
             offset=NULL, nest, delta=1, maxiter=20, points=10, print.level=0,
             control=glm.control(epsilon=0.0001,maxit=10,trace=FALSE))

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

 formula: A symbolic description of the model to be fitted. If it
          contains transformations of the data, including cbind for
          binomial data, a dataframe must be supplied.

  family: A description of the error distribution and link function to
          be used in the model; see 'family' for details.

    data: A dataframe containing the variables in the model, that is
          optional in simple cases, but required in certain situations
          as specified elsewhere in this help page.

 weights: An optional weight vector. If this is used, data must be
          supplied in a data.frame.

  offset: The known component in the linear predictor. If this is used,
          data must be supplied in a data.frame. An offset cannot be
          specified in the model formula.

    nest: The variable classifying observations by the unit (cluster)
          upon which they were observed.

   delta: If the response variable has been transformed, this is the
          Jacobian of that transformation, so that AICs are comparable.

 maxiter: The maximum number of iterations of the outer loop for
          numerical integration.

  points: The number of points for Gauss-Hermite integration of the
          random effect.

print.level: If set equal to 2, the log probabilities are printed out
          when the underflow error is given.

 control: A list of parameters for controlling the fitting process.

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

     'glmm' returns a list of class 'glmm'

_A_u_t_h_o_r(_s):

     J.K. Lindsey

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

     'family', 'fmr', 'glm', 'glm.control', 'gnlmix', 'gnlmm', 'gnlr',
     'gnlr3', 'hnlmix', 'nls'.

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

     # Poisson counts
     nest <- gl(5,4)
     y <- rpois(20,5+2*as.integer(nest))
     # overdispersion model
     glmm(y~1, family=poisson, nest=gl(20,1), points=3)
     # clustered model
     glmm(y~1, family=poisson, nest=nest, points=3)
     #
     # binomial data with model for overdispersion
     df <- data.frame(r=rbinom(10,10,0.5), n=rep(10,10), x=c(rep(0,5),
             rep(1,5)), nest=1:10)
     glmm(cbind(r,n-r)~x, family=binomial, nest=nest, data=df)

