VGAM (version 1.0-4)

quasibinomialff: Quasi-Binomial Family Function

Description

Family function for fitting generalized linear models to binomial responses, where the dispersion parameters are unknown.

Usage

quasibinomialff(link = "logit", multiple.responses = FALSE,
                onedpar = !multiple.responses, parallel = FALSE, zero = NULL)

Arguments

link

Link function. See Links for more choices.

multiple.responses

Multiple responses? If TRUE, then the response is interpreted as \(M\) binary responses, where \(M\) is the number of columns of the response matrix. In this case, the response matrix should have zero/one values only.

If FALSE and the response is a (2-column) matrix, then the number of successes is given in the first column and the second column is the number of failures.

onedpar

One dispersion parameter? If multiple.responses, then a separate dispersion parameter will be computed for each response (column), by default. Setting onedpar=TRUE will pool them so that there is only one dispersion parameter to be estimated.

parallel

A logical or formula. Used only if multiple.responses is TRUE. This argument allows for the parallelism assumption whereby the regression coefficients for a variable is constrained to be equal over the \(M\) linear/additive predictors.

zero

Can be an integer-valued vector specifying which linear/additive predictors are modelled as intercepts only. The values must be from the set {1,2,…,\(M\)}, where \(M\) is the number of columns of the matrix response. See CommonVGAMffArguments for more information.

Value

An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, vgam, rrvglm, cqo, and cao.

Warning

The log-likelihood pertaining to the ordinary family is used to test for convergence during estimation, and is printed out in the summary.

Details

The final model is not fully estimated by maximum likelihood since the dispersion parameter is unknown (see pp.124--8 of McCullagh and Nelder (1989) for more details).

A dispersion parameter that is less/greater than unity corresponds to under-/over-dispersion relative to the binomial model. Over-dispersion is more common in practice.

Setting multiple.responses=TRUE is necessary when fitting a Quadratic RR-VGLM (see cqo) because the response will be a matrix of \(M\) columns (e.g., one column per species). Then there will be \(M\) dispersion parameters (one per column of the response).

References

McCullagh, P. and Nelder, J. A. (1989) Generalized Linear Models, 2nd ed. London: Chapman & Hall.

See Also

binomialff, rrvglm, cqo, cao, logit, probit, cloglog, cauchit, poissonff, quasipoissonff, quasibinomial.

Examples

Run this code
# NOT RUN {
quasibinomialff()
quasibinomialff(link = "probit")

# Nonparametric logistic regression
hunua <- transform(hunua, a.5 = sqrt(altitude))  # Transformation of altitude
fit1 <- vglm(agaaus ~ poly(a.5, 2), quasibinomialff, hunua)
fit2 <- vgam(agaaus ~ s(a.5, df = 2), quasibinomialff, hunua)
# }
# NOT RUN {
plot(fit2, se = TRUE, llwd = 2, lcol = "orange", scol = "orange",
     xlab = "sqrt(altitude)", ylim = c(-3, 1),
     main = "GAM and quadratic GLM fitted to species data")
plotvgam(fit1, se = TRUE, lcol = "blue", scol = "blue", add = TRUE, llwd = 2)
# }
# NOT RUN {
fit1@misc$dispersion # dispersion parameter
logLik(fit1)

# Here, the dispersion parameter defaults to 1
fit0 <- vglm(agaaus ~ poly(a.5, 2), binomialff, hunua)
fit0@misc$dispersion # dispersion parameter
# }

Run the code above in your browser using DataCamp Workspace