betabin {aod} | R Documentation |
Beta-Binomial Model for Proportions
Description
Fits a beta-binomial generalized linear model accounting for overdispersion in clustered binomial data .
Usage
betabin(formula, random, data, link = c("logit", "cloglog"), phi.ini = NULL,
warnings = FALSE, na.action = na.omit, fixpar = list(),
hessian = TRUE, control = list(maxit = 2000), ...)
Arguments
formula |
A formula for the fixed effects |
random |
A right-hand formula for the overdispersion parameter(s) |
link |
The link function for the mean |
data |
A data frame containing the response ( |
phi.ini |
Initial values for the overdispersion parameter(s) |
warnings |
Logical to control the printing of warnings occurring during log-likelihood maximization.
Default to |
na.action |
A function name: which action should be taken in the case of missing value(s). |
fixpar |
A list with 2 components (scalars or vectors) of the same size, indicating which parameters are
fixed (i.e., not optimized) in the global parameter vector |
hessian |
A logical. When set to |
control |
A list to control the optimization parameters. See |
... |
Further arguments passed to |
Details
For a given cluster , the model is:
with following a Beta distribution
.
If denotes the beta function, then:
The marginal beta-binomial distribution is:
The function uses the parameterization and
,
where
is the inverse of the link function (logit or complementary log-log),
is a design-matrix,
is a vector of fixed effects,
is the linear predictor and
is the overdispersion
parameter (i.e., the intracluster correlation coefficient, which is here restricted to be positive).
The marginal mean and variance are:
The parameters and
are estimated by maximizing the log-likelihood of the marginal model (using the
function
optim
). Several explanatory variables are allowed in , only one in
.
Value
An object of formal class “glimML”: see glimML-class
for details.
Author(s)
Matthieu Lesnoff matthieu.lesnoff@cirad.fr, Renaud Lancelot renaud.lancelot@cirad.fr
References
Crowder, M.J., 1978. Beta-binomial anova for proportions. Appl. Statist. 27, 34-37.
Griffiths, D.A., 1973. Maximum likelihood estimation for the beta-binomial distribution and an application
to the household distribution of the total number of cases of disease. Biometrics 29, 637-648.
Prentice, R.L., 1986. Binary regression using an extended beta-binomial distribution, with discussion of
correlation induced by covariate measurement errors. J.A.S.A. 81, 321-327.
Williams, D.A., 1975. The analysis of binary responses from toxicological experiments involving
reproduction and teratogenicity. Biometrics 31, 949-952.
See Also
glimML-class
, glm
and optim
Examples
data(orob2)
fm1 <- betabin(cbind(y, n - y) ~ seed, ~ 1, data = orob2)
fm2 <- betabin(cbind(y, n - y) ~ seed + root, ~ 1, data = orob2)
fm3 <- betabin(cbind(y, n - y) ~ seed * root, ~ 1, data = orob2)
# show the model
fm1; fm2; fm3
# AIC
AIC(fm1, fm2, fm3)
summary(AIC(fm1, fm2, fm3), which = "AICc")
# Wald test for root effect
wald.test(b = coef(fm3), Sigma = vcov(fm3), Terms = 3:4)
# likelihood ratio test for root effect
anova(fm1, fm3)
# model predictions
New <- expand.grid(seed = levels(orob2$seed),
root = levels(orob2$root))
data.frame(New, predict(fm3, New, se = TRUE, type = "response"))
# Djallonke sheep data
data(dja)
betabin(cbind(y, n - y) ~ group, ~ 1, dja)
# heterogeneous phi
betabin(cbind(y, n - y) ~ group, ~ group, dja,
control = list(maxit = 1000))
# phi fixed to zero in group TREAT
betabin(cbind(y, n - y) ~ group, ~ group, dja,
fixpar = list(4, 0))
# glim without overdispersion
summary(glm(cbind(y, n - y) ~ group,
family = binomial, data = dja))
# phi fixed to zero in both groups
betabin(cbind(y, n - y) ~ group, ~ group, dja,
fixpar = list(c(3, 4), c(0, 0)))