Learn R Programming

eha (version 2.4-5)

glmmML.fit: Generalized Linear Model with random intercept

Description

This function is called by glmmML, but it can also be called directly by the user.

Usage

glmmML.fit(X, Y, weights = rep(1, NROW(Y)), cluster.weights = rep(1, NROW(Y)),
start.coef = NULL, start.sigma = NULL,
fix.sigma = FALSE,
cluster = NULL, offset = rep(0, nobs), family = binomial(),
method = 1, n.points = 1,
control = list(epsilon = 1.e-8, maxit = 200, trace = FALSE),
intercept = TRUE, boot = 0, prior = 0)

Arguments

X
Design matrix of covariates.
Y
Response vector. Or two-column matrix.
weights
Case weights. Defaults to one.
cluster.weights
Cluster weights. Defaults to one.
start.coef
Starting values for the coefficients.
start.sigma
Starting value for the mixing standard deviation.
fix.sigma
Should sigma be fixed at start.sigma?
cluster
The clustering variable.
offset
The offset in the model.
family
Family of distributions. Defaults to binomial with logit link. Other possibilities are binomial with cloglog link and poisson with log link.
method
Laplace (1) or Gauss-hermite (0)?
n.points
Number of points in the Gauss-Hermite quadrature. Default is n.points = 1, which is equivalent to Laplace approximation.
control
Control of the iterations. See glm.control.
intercept
Logical. If TRUE, an intercept is fitted.
boot
Integer. If > 0, bootstrapping with boot replicates.
prior
Which prior distribution? 0 for "gaussian", 1 for "logistic", 2 for "cauchy".

Value

A list. For details, see the code, and glmmML.

Details

In the optimisation, "vmmin" (in C code) is used.

References

Brostr<U+001ADF7B>Bridgewater

See Also

glmmML, glmmPQL in the package MASS, and lmer in the package lme4.

Examples

Run this code
x <- cbind(rep(1, 14), rnorm(14))
y <- rbinom(14, prob = 0.5, size = 1)
id <- rep(1:7, 2)

glmmML.fit(x, y, cluster = id)


Run the code above in your browser using DataLab