ezglm {ezglm} | R Documentation |
selects significant non-additive interaction between two variables using fast GLM implementation.
ezglm(y, x1, x2, thr = 1, family=c("gaussian","binomial"))
y |
response variable, of length |
x1 |
the first predictor, of length |
x2 |
the second predictor, of length |
thr |
p-value tolerance. Truncate any p-value to 1 if it is larger than |
family |
a character string specifying the model to use, valid options are:
Default is |
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
the significant non-additive interactions between two variables.
Once a user specifies a reponse variable y
and predictors x1
and x2
,
for "gaussian"
a least squares model y ~ x1 + x2 + x1*x2
is fitted;
for "binomial"
a logistic regression logit ~ x1 + x2 + x1*x2
is fitted.
Users can then select significant x1*x2 term using returned p-value of Wald test.
A matrix of coefficients.
Yi Yang
Maintainer: Yi Yang <yiyang@umn.edu>
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