Fit a GLMM model with multivariate normal random effects, using Penalized Quasi-Likelihood.

glmmPQL(fixed, random, family, data, correlation, weights,
        control, niter = 10, verbose = TRUE, ...)

Arguments

fixed

a two-sided linear formula giving fixed-effects part of the model.

random

a formula or list of formulae describing the random effects.

family

a GLM family.

data

an optional data frame used as the first place to find variables in the formulae, weights and if present in ..., subset.

correlation

an optional correlation structure.

weights

optional case weights as in glm.

control

an optional argument to be passed to lme.

niter

maximum number of iterations.

verbose

logical: print out record of iterations?

...

Further arguments for lme.

Value

A object of class "lme": see lmeObject.

Details

glmmPQL works by repeated calls to lme, so package nlme will be loaded at first use if necessary.

References

Schall, R. (1991) Estimation in generalized linear models with random effects. Biometrika 78, 719--727.

Breslow, N. E. and Clayton, D. G. (1993) Approximate inference in generalized linear mixed models. Journal of the American Statistical Association 88, 9--25.

Wolfinger, R. and O'Connell, M. (1993) Generalized linear mixed models: a pseudo-likelihood approach. Journal of Statistical Computation and Simulation 48, 233--243.

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

See also

Examples

library(nlme) # will be loaded automatically if omitted summary(glmmPQL(y ~ trt + I(week > 2), random = ~ 1 | ID, family = binomial, data = bacteria))
#> iteration 1
#> iteration 2
#> iteration 3
#> iteration 4
#> iteration 5
#> iteration 6
#> Linear mixed-effects model fit by maximum likelihood #> Data: bacteria #> AIC BIC logLik #> NA NA NA #> #> Random effects: #> Formula: ~1 | ID #> (Intercept) Residual #> StdDev: 1.410637 0.7800511 #> #> Variance function: #> Structure: fixed weights #> Formula: ~invwt #> Fixed effects: y ~ trt + I(week > 2) #> Value Std.Error DF t-value p-value #> (Intercept) 3.412014 0.5185033 169 6.580506 0.0000 #> trtdrug -1.247355 0.6440635 47 -1.936696 0.0588 #> trtdrug+ -0.754327 0.6453978 47 -1.168779 0.2484 #> I(week > 2)TRUE -1.607257 0.3583379 169 -4.485311 0.0000 #> Correlation: #> (Intr) trtdrg trtdr+ #> trtdrug -0.598 #> trtdrug+ -0.571 0.460 #> I(week > 2)TRUE -0.537 0.047 -0.001 #> #> Standardized Within-Group Residuals: #> Min Q1 Med Q3 Max #> -5.1985361 0.1572336 0.3513075 0.4949482 1.7448845 #> #> Number of Observations: 220 #> Number of Groups: 50
# an example of offset summary(glmmPQL(y ~ trt + week, random = ~ 1 | ID, family = binomial, data = bacteria))
#> iteration 1
#> iteration 2
#> iteration 3
#> iteration 4
#> iteration 5
#> iteration 6
#> Linear mixed-effects model fit by maximum likelihood #> Data: bacteria #> AIC BIC logLik #> NA NA NA #> #> Random effects: #> Formula: ~1 | ID #> (Intercept) Residual #> StdDev: 1.325243 0.7903088 #> #> Variance function: #> Structure: fixed weights #> Formula: ~invwt #> Fixed effects: y ~ trt + week #> Value Std.Error DF t-value p-value #> (Intercept) 3.0302276 0.4791396 169 6.324310 0.0000 #> trtdrug -1.2176812 0.6160113 47 -1.976719 0.0540 #> trtdrug+ -0.7886376 0.6193895 47 -1.273250 0.2092 #> week -0.1446463 0.0392343 169 -3.686730 0.0003 #> Correlation: #> (Intr) trtdrg trtdr+ #> trtdrug -0.622 #> trtdrug+ -0.609 0.464 #> week -0.481 0.050 0.030 #> #> Standardized Within-Group Residuals: #> Min Q1 Med Q3 Max #> -4.2868074 0.2039043 0.3140333 0.5440835 1.9754065 #> #> Number of Observations: 220 #> Number of Groups: 50
summary(glmmPQL(y ~ trt + week + offset(week), random = ~ 1 | ID, family = binomial, data = bacteria))
#> iteration 1
#> iteration 2
#> iteration 3
#> iteration 4
#> iteration 5
#> iteration 6
#> Linear mixed-effects model fit by maximum likelihood #> Data: bacteria #> AIC BIC logLik #> NA NA NA #> #> Random effects: #> Formula: ~1 | ID #> (Intercept) Residual #> StdDev: 1.325243 0.7903088 #> #> Variance function: #> Structure: fixed weights #> Formula: ~invwt #> Fixed effects: y ~ trt + week + offset(week) #> Value Std.Error DF t-value p-value #> (Intercept) 3.0302276 0.4791396 169 6.324310 0.0000 #> trtdrug -1.2176812 0.6160113 47 -1.976719 0.0540 #> trtdrug+ -0.7886376 0.6193895 47 -1.273250 0.2092 #> week -1.1446463 0.0392343 169 -29.174622 0.0000 #> Correlation: #> (Intr) trtdrg trtdr+ #> trtdrug -0.622 #> trtdrug+ -0.609 0.464 #> week -0.481 0.050 0.030 #> #> Standardized Within-Group Residuals: #> Min Q1 Med Q3 Max #> -4.2868074 0.2039043 0.3140333 0.5440835 1.9754065 #> #> Number of Observations: 220 #> Number of Groups: 50