Learn R Programming

glmmML (version 0.65-2)

glmmboot: Generalized Linear Models with fixed effects grouping

Description

Fits grouped GLMs with fixed group effects. The significance of the grouping is tested by simulation, with a bootstrap approach.

Usage

glmmboot(formula, family = binomial, data, cluster, weights, subset, na.action,
offset, start.coef = NULL,
control = list(epsilon = 1e-08, maxit = 200, trace = FALSE), 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.
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.
weights
Case weights.
subset
an optional vector specifying a subset of observations to be used in the fitting process.
na.action
See glm.
offset
this can be used to specify an a priori known component to be included in the linear predictor during fitting.
start.coef
starting values for the parameters in the linear predictor. Defaults to zero.
control
Controls the convergence criteria. See glm.control for details.
boot
number of bootstrap replicates. If equal to zero, no test of significance of the grouping factor is performed.

Value

  • The return value is a list, an object of class 'glmmboot'.
  • coefficientsEstimated regression coefficients
  • logLikthe max log likelihood
  • cluster.null.devianceDeviance without the clustering
  • frailThe estimated cluster effects
  • bootLogThe logLik values from the bootstrap samples
  • bootPBootstrap p value
  • varianceVariance covariance matrix
  • sdStandard error of regression parameters
  • boot_repNo. of bootstrap replicates
  • mixedLogical
  • devianceDeviance
  • df.residualIts degrees of freedom
  • aicAIC
  • bootLogical
  • callThe function call

encoding

UTF-8

Details

The simulation is performed by simulating new response vectors from the fitted probabilities without clustering, and comparing the maximized log likelihoods. The maximizations are performed by profiling out the grouping factor. It is a very fast procedure, compared to glm, when the grouping factor has many levels.

See Also

link{glmmML}, optim, glmm in repeated, lmer in Matrix, and glmmPQL in MASS.

Examples

Run this code
## Not run:
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)
res <- glmmboot(y ~ x, cluster = id, data = dat, boot = 5000)
## End(Not run)
##system.time(res.glm <- glm(y ~ x + id, family = binomial))

Run the code above in your browser using DataLab