Learn R Programming

glmmML (version 0.30-2)

glmmML: Generalized Linear Models with random intercept

Description

Fits GLMs with random intercept by Maximum Likelihood and numerical integration via Gauss-Hermite quadrature.

Usage

glmmML(formula, family = binomial, data, cluster, subset, na.action, 
offset, start.coef = NULL, start.sigma = NULL,
control = list(epsilon = 1e-08, maxit = 200, trace = FALSE),
n.points = 16, boot = 0)

Arguments

formula
a symbolic description of the model to be fit. The details of model specification are given below.
family
Currently, the only valid values are binomial and poisson. The binomial family allows for the logit and cloglog links, but can only be represented as binary data.
data
an optional data frame containing the variables in the model. By default the variables are taken from `environment(formula)', typically the environment from which `glmmML' is called.
cluster
Factor indicating which items are correlated.
subset
an optional vector specifying a subset of observations to be used in the fitting process.
na.action
See glm.
start.coef
starting values for the parameters in the linear predictor. Defaults to zero.
start.sigma
starting value for the mixing standard deviation. Defaults to 0.5.
offset
this can be used to specify an a priori known component to be included in the linear predictor during fitting.
control
Controls the convergence criteria. See glm.control for details.
n.points
Number of points in the Gauss-Hermite quadrature. If n.points == 1, the Gauss-Hermite is the same as Laplace approximation.
boot
Do you want a bootstrap estimate of cluster effect? The default is No (boot = 0). If you want to say yes, enter a positive integer here. It should be equal to the number of bootstrap samples you want to draw. A recomended

Value

  • The return value is a list, an object of class 'glmmML'. The components are:
  • bootNo. of boot replicates
  • convergedLogical
  • coefficientsEstimated regression coefficients
  • coef.sdTheir standard errors
  • sigmaThe estimated random effects' standard deviation
  • sigma.sdIts standard error
  • varianceThe estimated variance-covariance matrix. The last column/row corresponds to the log of the standard deviation of the random effects (log(sigma))
  • aicAIC
  • bootPBootstrap p value from testing the null hypothesis of no random effect (sigma = 0)
  • devianceDeviance
  • mixedLogical
  • df.residualDegrees of freedom
  • cluster.null.devianceDeviance from a glm with no clustering
  • cluster.null.dfIts degrees of freedom
  • posterior.modesEstimated posterior modes of the random effects
  • posterior.meansEstimated posterior means of the random effects
  • callThe function call

Details

The integrals in the log likelihood function are evaluated by Gauss-Hermite quadrature. For the integrals in the partial derivatives and in the hessian, the R function 'integrate' (in its C form, 'Rdqagi') is used.

References

Brostr�m (2003). Generalized linear models with random intercepts. http://www.stat.umu.se/forskning/reports/glmmML.pdf

See Also

glmmboot, optim, glmm in Lindsey's repeated package, lmer in Matrixand glmmPQL in MASS.

Examples

Run this code
id <- factor(rep(1:20, rep(5, 20)))
y <- rbinom(100, prob = rep(runif(20), rep(5, 20)), size = 1)
x <- rnorm(100)
dat <- data.frame(y = y, x = x, id = id)
glmmML(y ~ x, data = dat, cluster = id)

Run the code above in your browser using DataLab