View source: R/wald.logisticregs.R
Many Wald based tests for logistic and Poisson regressions with continuous predictors | R Documentation |
Many Wald based tests for logistic and Poisson regressions with continuous predictors.
wald.logisticregs(y, x, tol = 1e-09, wei = NULL, check = FALSE, logged = FALSE, ncores = 1) wald.poissonregs(y, x, tol = 1e-09, wei = NULL, check = FALSE, logged = FALSE, ncores = 1)
y |
A vector with either 0s and 1 (logistic regression) or discrete data, counts (Poisson regression). |
x |
A data.frame, the predictor variables. If you have no categorical variables, the fucntion will still work but it's better to use the |
tol |
The tolerance value to stop the Newton-Raphson iterations. It is set to 1e-09 by default. |
wei |
A vector of weights to be used for weighted regression. The default value is NULL. An example where weights are used is surveys when stratified sampling has occured. |
check |
A boolean variable indicating whether to chekc for variables with identical values. The defauls is FALSE. |
logged |
A boolean variable; it will return the logarithm of the pvalue if set to TRUE. |
ncores |
How many to cores to useq the default value is 1. |
Instead of using R built-in function glm
we implemented the newton-Raphson in order to avoid unnecessary calculations. The functions are much faster.
A matrix with three columns, the test statistic, its associated (logged) p-value and the BIC of each model.
Michail Tsagris
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr and Manos Papadakis <papadakm95@gmail.com>.
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.
univregs, perm.univregs
## 20 variables, hence 20 univariate regressions are to be fitted x <- matrix( rnorm(200 * 20), ncol = 20 ) y <- rpois(200, 4) a <- wald.poissonregs(y, x) b <- univregs(y, x, test = testIndPois) cor(exp(a[, 2]), exp(b$pvalue) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.