Many univariate generalised linear models {Rfast}R Documentation

Many univariate generalised linear regressions


It performs very many univariate generalised linear regressions.


univglms(y, x, oiko = NULL, logged = FALSE)

univglms2(y, x, oiko = NULL, logged = FALSE)



The dependent variable. It can be a factor or a numerical variable with two values only (binary logistic regression), a discrete valued vector (count data) corresponding to a poisson regression or a numerical vector with continuous values (normal regression).


A matrix with the data, where the rows denote the samples (and the two groups) and the columns are the variables. For the "univglms" only continuous variables are allowed. You are advised to standardise the data before hand to avoid numerical overflow or similar issues. If you see NaN in the outcome, this might be the case. For the "univglms2" categorical variables are allowed and hence this accepts data.frames. In this case, the categorical variables must be given as factor variables, otherwise you might get wrong results.


This can be either "normal", "poisson", "quasipoisson" or "binomial". If you are not sure leave it NULL and the function will check internally. However, you might have discrete data (e.g. years of age) and want to perform many simple linear regressions. In this case you should specify the family.


A boolean variable; it will return the logarithm of the pvalue if set to TRUE.


If you specify no family of distributions the function internally checkes the type of your data and decides on the type of regression to perform. 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.


A matrix with the test statistic and the p-value for each predictor variable.


Michail Tsagris

R implementation and documentation: Michail Tsagris <> and Manos Papadakis <>.


Draper, N.R. and Smith H. (1988). Applied regression analysis. New York, Wiley, 3rd edition.

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

See Also

logistic_only, poisson_only, allbetas, correls, regression


## Not run: 
x <- matrnorm(100, 50)
y <- rbinom(100, 1, 0.6)   ## binary logistic regression
a1 <- univglms(y, x) 
a2 <- glm(y ~ x[, 1], binomial)$deviance
a2 <- glm(y ~ 1, binomial)$ - a2
x <- NULL

## End(Not run)

[Package Rfast version 2.0.4 Index]