View source: R/regression_models.R
Binomial regression | R Documentation |
Binomial regression.
binom.reg(y, ni, x, full = FALSE, tol = 1e-07, maxiters = 100)
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. |
The difference from logistic regression is that in the binomial regression the binomial distribution is used and not the Bernoulli.
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. |
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
McCullagh Peter and John A. Nelder. Generalized linear models. CRC Press, USA, 2nd edition, 1989.
negbin.reg, hp.reg, ztp.reg
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.