Title: | An Adaptive Test on High Dimensional Parameters in Generalized Linear Models |
---|---|
Description: | Several tests for high dimensional generalized linear models have been proposed recently. In this package, we implemented a new test called aSPU for high dimensional generalized linear models, which is often more powerful than the existing methods in a wide scenarios. We also implemented permutation based version of several existing methods for research purpose. We recommend users use the aSPU test for their real testing problem. |
Authors: | Chong Wu and Wei Pan |
Maintainer: | Chong Wu <[email protected]> |
License: | GPL-2 |
Version: | 1.1 |
Built: | 2024-11-05 03:25:59 UTC |
Source: | https://github.com/chongwu-biostat/glmaspu |
Provide various tests on high-dimensional parameters in generalized linear models.
Several tests for high dimensional generalized linear models have been proposed recently. In this package, we implemented a new test called aSPU for high dimensional generalized linear models, which is often more powerful than the existing methods in a wide scenarios. We also implemented permutation based version of several existing methods for research purpose. We recommend users use the aSPU test for their real testing problem.
Chong Wu, Wei Pan Maintainer: Chong Wu <[email protected]>
Chong Wu, Gongjun Xu and Wei Pan, "An Adaptive test on high dimensional parameters in generalized linear models" (Submitted)
It gives p-values of the SPU tests and aSPU test.
aSPU_apval(Y, X, cov = NULL, pow = c(1:6, Inf), resample = "boot", model = "gaussian", n.perm = 5000)
aSPU_apval(Y, X, cov = NULL, pow = c(1:6, Inf), resample = "boot", model = "gaussian", n.perm = 5000)
Y |
Response. It can be binary or continuous trait. A vector with length n (number of observations). |
X |
Genotype or other data; each row for a subject, and each column for a variable of interest. An n by p matrix (n: number of observations, p: number of predictors). |
cov |
Covariates. An n by q matrix (n: number of observations, q: number of covariates). |
pow |
Gamma set used in SPU test. A vector of the powers. |
resample |
Resample methods. "perm" for residual permutations; "boot" for parametric bootstrap. |
model |
corresponding to the Response. "gaussian" for a quantitative response; "binomial" for a binary response. |
n.perm |
number of permutations or bootstraps. |
A list object, Ts : test statistics for the SPU tests and the aSPU test. pvs : p-values for the SPU and aSPU tests.
Chong Wu and Wei Pan
Chong Wu, Gongjun Xu and Wei Pan, "An Adaptive test on high dimensional parameters in generalized linear models" (Submitted)
p = 200 n = 100 beta = c(1,3,3) s = 0.15 non.zero = floor(p * s) signal.r = 0.02 seed = 1 alpha = c(rep(signal.r,non.zero),rep(0,p-non.zero)) dat = generate_data(seed, n = n, p = p, beta = beta,alpha = alpha) cov = dat$Z X = dat$X Y = dat$Y aSPU_apval(Y, X, cov = cov, pow = c(1:6, Inf),resample = "perm", model = "gaussian", n.perm = 1000) # The p-values are similar to the resample based one
p = 200 n = 100 beta = c(1,3,3) s = 0.15 non.zero = floor(p * s) signal.r = 0.02 seed = 1 alpha = c(rep(signal.r,non.zero),rep(0,p-non.zero)) dat = generate_data(seed, n = n, p = p, beta = beta,alpha = alpha) cov = dat$Z X = dat$X Y = dat$Y aSPU_apval(Y, X, cov = cov, pow = c(1:6, Inf),resample = "perm", model = "gaussian", n.perm = 1000) # The p-values are similar to the resample based one
aSPU_perm
returns p-values of the SPU tests and aSPU test.
aSPU_perm(Y, X, cov = NULL, resample = c("perm", "boot"), model = c("gaussian", "binomial"), pow = c(1:6, Inf), n.perm = 1000)
aSPU_perm(Y, X, cov = NULL, resample = c("perm", "boot"), model = c("gaussian", "binomial"), pow = c(1:6, Inf), n.perm = 1000)
Y |
Response. It can be binary or continuous trait. A vector with length n (number of observations). |
X |
Genotype or other data; each row for a subject, and each column for a variable of interest. An n by p matrix (n: number of observations, p: number of predictors). |
cov |
Covariates. An n by q matrix (n: number of observations, q: number of covariates). |
resample |
Resample methods. "perm" for residual permutations; "boot" for parametric bootstrap. |
model |
corresponding to the Response. "gaussian" for a quantitative response; "binomial" for a binary response. |
pow |
Gamma set used in SPU test. A vector of the powers. |
n.perm |
number of permutations or bootstraps. |
A list object, Ts : test statistics for the SPU tests and the aSPU test. pvs : p-values for the SPU and aSPU tests.
Chong Wu and Wei Pan
Wei Pan, Junghi Kim, Yiwei Zhang, Xiaotong Shen and Peng Wei (2014) A powerful and adaptive association test for rare variants, Genetics, 197(4), 1081-95
p = 200 n = 100 beta = c(1,3,3) s = 0.15 signal.r = 0.02 non.zero = floor(p * s) seed = 1 alpha = c(rep(signal.r,non.zero),rep(0,p-non.zero)) dat = generate_data(seed, n = n, p = p, beta = beta,alpha = alpha) cov = dat$Z X = dat$X Y = dat$Y aSPU_perm(Y, X, cov = cov, pow = c(1:6, Inf),resample = "perm", model = "gaussian", n.perm = 1000) # The p-values are similar to the asymptotic based one
p = 200 n = 100 beta = c(1,3,3) s = 0.15 signal.r = 0.02 non.zero = floor(p * s) seed = 1 alpha = c(rep(signal.r,non.zero),rep(0,p-non.zero)) dat = generate_data(seed, n = n, p = p, beta = beta,alpha = alpha) cov = dat$Z X = dat$X Y = dat$Y aSPU_perm(Y, X, cov = cov, pow = c(1:6, Inf),resample = "perm", model = "gaussian", n.perm = 1000) # The p-values are similar to the asymptotic based one
generate_data
returns simulated data, including response Y, covariates Z, and variable of interest X.
generate_data(seed, n, p, beta, alpha)
generate_data(seed, n, p, beta, alpha)
seed |
Random seed. |
n |
Number of samples |
p |
Dimension of variable of interest |
beta |
Coefficients for covariates Z |
alpha |
Coefficients for variable of interest X |
A list object
Chong Wu and Wei Pan
Chong Wu, Gongjun Xu and Wei Pan, "An Adaptive test on high dimensional parameters in generalized linear models" (Submitted)
p = 100 n = 50 beta = c(1,3,3) s = 0.15 signal.r = 0.02 non.zero = floor(p * s) seed = 1 alpha = c(rep(signal.r,non.zero),rep(0,p-non.zero)) dat = generate_data(seed, n = n, p = p, beta = beta,alpha = alpha) #X, Y, cov #dat$X; dat$Y; dat$cov
p = 100 n = 50 beta = c(1,3,3) s = 0.15 signal.r = 0.02 non.zero = floor(p * s) seed = 1 alpha = c(rep(signal.r,non.zero),rep(0,p-non.zero)) dat = generate_data(seed, n = n, p = p, beta = beta,alpha = alpha) #X, Y, cov #dat$X; dat$Y; dat$cov
HDGLM_perm
returns resample based p-value for HDGLM test (Guo 2016).
HDGLM_perm(Y, X, cov = NULL, model = c("gaussian", "binomial"), n.perm = 1000)
HDGLM_perm(Y, X, cov = NULL, model = c("gaussian", "binomial"), n.perm = 1000)
Y |
Response. It can be binary or continuous trait. A vector with length n (number of observations). |
X |
Genotype or other data; each row for a subject, and each column for a variable of interest. An n by p matrix (n: number of observations, p: number of predictors). |
cov |
Covariates. An n by q matrix (n: number of observations, q: number of covariates). |
model |
corresponding to the Response. "gaussian" for a quantitative response; "binomial" for a binary response. |
n.perm |
number of permutations or bootstraps. |
HDGLM_perm
calculates the resample based p-value. You can calculate the asymptotic based p-value by using HDGLM_test function in R package HDGLM. Based on our experience, resample based p-value is often similar to the asymptotic based one, except when the signals are highly sparse.
A list object, Ts : test statistics for the SPU tests and the aSPU test. pvs : p-values for the SPU and aSPU tests.
Chong Wu and Wei Pan
Guo, B. and S. X. Chen (2016). Tests for high dimensional generalized linear models. Journal of the Royal Statistical Society: Series B (Statistical Methodology).
p = 200 n = 100 beta = c(1,3,3) s = 0.15 signal.r = 0.02 seed = 1 non.zero = floor(p * s) alpha = c(rep(signal.r,non.zero),rep(0,p-non.zero)) dat = generate_data(seed, n = n, p = p, beta = beta,alpha = alpha) cov = dat$Z X = dat$X Y = dat$Y HDGLM_perm(Y, X, cov = cov, model = "gaussian", n.perm = 1000)
p = 200 n = 100 beta = c(1,3,3) s = 0.15 signal.r = 0.02 seed = 1 non.zero = floor(p * s) alpha = c(rep(signal.r,non.zero),rep(0,p-non.zero)) dat = generate_data(seed, n = n, p = p, beta = beta,alpha = alpha) cov = dat$Z X = dat$X Y = dat$Y HDGLM_perm(Y, X, cov = cov, model = "gaussian", n.perm = 1000)