binom.reg: Binomial regression

View source: R/regression_models.R

Binomial regressionR Documentation

Binomial regression

Description

Binomial regression.

Usage

binom.reg(y, ni, x, full = FALSE, tol = 1e-07, maxiters = 100)

Arguments

y

The dependent variable; a numerical vector with integer values, 0, 1, 2,... The successes.

ni

A vector with integer values, greater than or equal to y. The trials.

x

A matrix with the data, where the rows denote the samples (and the two groups) and the columns are the variables. This can be a matrix or a data.frame (with factors).

full

If this is FALSE, the coefficients and the deviance will be returned only. If this is TRUE, more information is returned.

tol

The tolerance value to terminate the Newton-Raphson algorithm.

maxiters

The max number of iterations that can take place in each regression.

Details

The difference from logistic regression is that in the binomial regression the binomial distribution is used and not the Bernoulli.

Value

When full is FALSE a list including:

be

The regression coefficients.

devi

The deviance of the model.

When full is TRUE a list including:

info

The regression coefficients, their standard error, their Wald test statistic and their p-value.

devi

The deviance.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

McCullagh Peter and John A. Nelder. Generalized linear models. CRC Press, USA, 2nd edition, 1989.

See Also

negbin.reg, hp.reg, ztp.reg

Examples

x <- matrix(rnorm(100 * 2), ncol = 2)
y <- rbinom(100, 20, 0.5)   ## binary logistic regression
ni <- rep(20, 100)
a <- binom.reg(y, ni, x, full = TRUE) 
x <- NULL

Rfast2 documentation built on May 29, 2024, 8:45 a.m.