glmmPQL {BradleyTerry2}  R Documentation 
PQL Estimation of Generalized Linear Mixed Models
Description
Fits GLMMs with simple random effects structure via Breslow and Clayton's
PQL algorithm.
The GLMM is assumed to be of the form g(μ) =
Xβ + Ze where g
is the link
function, μ is the
vector of means and X, Z are design matrices for the fixed effects
β and random
effects e respectively.
Furthermore the random effects are assumed to be i.i.d.
N(0, σ^{2}).
Usage
glmmPQL(
fixed,
random = NULL,
family = "binomial",
data = NULL,
subset = NULL,
weights = NULL,
offset = NULL,
na.action = NULL,
start = NULL,
etastart = NULL,
mustart = NULL,
control = glmmPQL.control(...),
sigma = 0.1,
sigma.fixed = FALSE,
model = TRUE,
x = FALSE,
contrasts = NULL,
...
)
Arguments
fixed 
a formula for the fixed effects. 
random 
a design matrix for the random effects, with number of rows
equal to the length of variables in 
family 
a description of the error distribution and link function to
be used in the model. This can be a character string naming a family
function, a family function or the result of a call to a family function.
(See 
data 
an optional data frame, list or environment (or object coercible
by 
subset 
an optional logical or numeric vector specifying a subset of observations to be used in the fitting process. 
weights 
an optional vector of ‘prior weights’ to be used in the fitting process. 
offset 
an optional numeric vector to be added to the linear predictor
during fitting. One or more 
na.action 
a function which indicates what should happen when the data
contain 
start 
starting values for the parameters in the linear predictor. 
etastart 
starting values for the linear predictor. 
mustart 
starting values for the vector of means. 
control 
a list of parameters for controlling the fitting process.
See the 
sigma 
a starting value for the standard deviation of the random effects. 
sigma.fixed 
logical: whether or not the standard deviation of the random effects should be fixed at its starting value. 
model 
logical: whether or not the model frame should be returned. 
x 
logical: whether or not the design matrix for the fixed effects should be returned. 
contrasts 
an optional list. See the 
... 
arguments to be passed to 
Value
An object of class "BTglmmPQL"
which inherits from
"glm"
and "lm"
:
coefficients 
a named vector of
coefficients, with a 
residuals 
the working residuals from the final iteration of the IWLS loop. 
random 
the design matrix for the random effects. 
fitted.values 
the fitted mean values, obtained by transforming the linear predictors by the inverse of the link function. 
rank 
the numeric rank of the fitted linear model. 
family 
the 
linear.predictors 
the linear fit on link scale. 
deviance 
up to a constant, minus twice the maximized loglikelihood. 
aic 
a version of Akaike's An Information Criterion, minus
twice the maximized loglikelihood plus twice the number of parameters,
computed by the 
null.deviance 
the deviance for the null model, comparable with

iter 
the numer of iterations of the PQL algorithm. 
weights 
the working weights, that is the weights in the final iteration of the IWLS loop. 
prior.weights 
the weights initially
supplied, a vector of 
df.residual 
the residual degrees of freedom. 
df.null 
the residual degrees of freedom for the null model. 
y 
if requested (the default) the 
x 
if requested, the model matrix. 
model 
if requested (the default), the model frame. 
converged 
logical. Was the PQL algorithm judged to have converged? 
call 
the matched call. 
formula 
the formula supplied. 
terms 
the 
data 
the

offset 
the offset vector used. 
control 
the value of the 
contrasts 
(where relevant) the contrasts used. 
xlevels 
(where relevant) a record of the levels of the factors used in fitting. 
na.action 
(where relevant) information returned by 
sigma 
the estimated standard deviation of the random effects 
sigma.fixed 
logical: whether or not

varFix 
the variancecovariance matrix of the fixed effects 
varSigma 
the variance of 
Author(s)
Heather Turner
References
Breslow, N. E. and Clayton, D. G. (1993) Approximate inference in Generalized Linear Mixed Models. Journal of the American Statistical Association 88(421), 9–25.
Harville, D. A. (1977) Maximum likelihood approaches to variance component estimation and to related problems. Journal of the American Statistical Association 72(358), 320–338.
See Also
predict.BTglmmPQL()
,glmmPQL.control()
,BTm()
Examples
###############################################
## Crowder seeds example from Breslow & Clayton
###############################################
summary(glmmPQL(cbind(r, n  r) ~ seed + extract,
random = diag(nrow(seeds)),
family = "binomial", data = seeds))
summary(glmmPQL(cbind(r, n  r) ~ seed*extract,
random = diag(nrow(seeds)),
family = "binomial", data = seeds))