Learn R Programming

glmmML (version 0.11)

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, data = list(), cluster = NULL, family = binomial,
start.coef = NULL, start.sigma = NULL, offset = NULL, method = "vmmin",
control = glm.control(epsilon = 1e-08, maxit = 100, trace = FALSE),
n.points = 16)

Arguments

formula
a symbolic description of the model to be fit. The details of model specification are given below.
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
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.
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.
method
the method to be used in fitting the model. The default (and presently only) method `vmmin' uses the BFGS method in the 'optim' function.
control
Controls the convergence criteria. See glm.control for details.
n.points
Number of points in the Gauss-hermite quadrature. If n.points == 1, an ordinary glm is fitted.

Value

  • The return value is a list, an object of class 'glmmML'.

Details

After the 'vmmin' function has converged, an ordinary Newton-Raphson procedure finishes the maximization. As a by-product, the variance-covariance is estimated.

References

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

See Also

optim, glmm in Lindsey's repeated package, and glmmPQL in MASS.

Examples

Run this code
x <- cbind(rep(1, 14), rnorm(14))
y <- rbinom(14, prob = 0.5, size = 1)
id <- rep(1:7, 2)
dat <- data.frame(y = y, x1 = x[, 2])
glmmML(y ~ x1, data = dat, cluster = id)

Run the code above in your browser using DataLab