glm_logistic: Logistic and Poisson regression models In Rfast: A Collection of Efficient and Extremely Fast R Functions

Description

Logistic and Poisson regression models.

Usage

 ```1 2``` ```glm_logistic(x, y, full = FALSE,tol = 1e-09, maxiters = 100) glm_poisson(x, y, full = FALSE,tol = 1e-09) ```

Arguments

 `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). `y` The dependent variable; a numerical vector with two values (0 and 1) for the logistic regression or integer values, 0, 1, 2,... for the Poisson regression. `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 function is written in C++ and this is why it is very fast.

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.

References

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

```poisson_only, logistic_only, univglms, regression ```
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14``` ```## Not run: x <- matrix(rnorm(100 * 3), ncol = 3) y <- rbinom(100, 1, 0.6) ## binary logistic regression a1 <- glm_logistic(x, y, full = TRUE) a2 <- glm(y ~ x, binomial) x <- matrix(rnorm(100 * 3), ncol = 3) y <- rpois(100, 10) ## binary logistic regression b1 <- glm_poisson(x, y, full = TRUE) b2 <- glm(y ~ x, poisson) x<-y<-a1<-a2<-b1<-b2<-NULL ## End(Not run) ```