Description Usage Arguments Details Value Author(s) Examples
selects significant non-additive interaction between two variables using fast GLM implementation.
1 |
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>
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.