Rfast (version 1.7.3)

Many univariate simple poisson regressions: Many univariate simple poisson regressions

Description

It performs very many univariate simple poisson regressions.

Usage

poisson_only(x, y)

Arguments

x
A matrix with the data, where the rows denote the samples (and the two groups) and the columns are the variables. Currently only continuous variables are allowed.
y
The dependent variable; a numerical vector with many discrete values (count data).

Value

A vector with the deviance of each simple poisson regression model for each predictor variable.

Details

The function is written in C++ and this is why it is very fast. It can accept thousands of predictor variables. It is usefull for univariate screening. We provide no p-value correction (such as fdr or q-values); this is up to the user.

References

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

See Also

univglms, logistic_only, allbetas, regression

Examples

Run this code
## 500 variables, hence 500 univariate regressions are to be fitted
x = matrix( rnorm(100 * 500), ncol = 500 )

y = rpois(100, 10)
system.time( poisson_only(x, y) )

b1 = poisson_only(x, y) 
b1 = as.vector(b1)

b2 = numeric(500)
system.time( for (i in 1:500) b2[i] = glm(y ~ x[, i], poisson)$deviance )

b2 = as.vector(glm(y ~ 1, poisson)$null.dev) - as.vector(b2)

Run the code above in your browser using DataLab