Selects a significant non-additive interaction between two variables using a fast GLM implementation.
response variable, of length
the first predictor, of length
the second predictor, of length
p-value tolerance. Truncate any p-value to 1 if it is larger than
a character string specifying the model to use, valid options are:
Motivated by pairwise gene interaction selection in genome-wide association study (GWAS),
this package implements fast and simplified least squares,
and logistic regression for efficiently selecting
a significant non-additive interaction between two variables.
Once user specifies the response variable
y and predictors
then a least squares model (
y ~ x1 + x2 + x1*x2 or a logistic regression (
logit ~ x1 + x2 + x1*x2 is fitted.
Users can then select the significant x1*x2 term using returned Wald test p-value.
A matrix of coefficients.
Maintainer: Yi Yang <[email protected]>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
n = 10000 x1 = rnorm(n) x2 = rnorm(n) y1 = sample(c(0,1),n,rep=TRUE) y2 = rnorm(n) system.time(m1 <- ezglm(y1, x1, x2, 1, family = "binomial")) m1 system.time(m2 <- glm(y1~x1+x2+x1*x2, family = binomial)) summary(m2)$coef system.time(m3 <- ezglm(y2, x1, x2, 1, family = "gaussian")) m3 system.time(m4 <- glm(y2~x1+x2+x1*x2, family = gaussian)) summary(m4)$coef
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.