Description Usage Arguments Value References Examples
An adaptive sum of powered correlation test (aSPC) for association between two random vectors
1 2 |
df1, |
first sample matrix |
df2, |
second sample matrix |
pow, |
power integer candidates, default c(1:8, Inf) |
B, |
number of permutations to calculate a P-value. Default is 100. |
Z.transform, |
whether to do Fisher's z-transformation on Pearson correlation, default is TRUE. |
method, |
one of "pearson", "spearman", or "dcor". Default is "pearson". |
the P-values of SPC and aSPC tests
Xu Z., Pan W. 2017. Adaptive testing for association between two random vectors in moderate to high dimensions. Submitted to Genetic Epidemiology
Kim J., Zhang Y., Pan W. Powerful and Adaptive Testing for Multi-trait and Multi-SNP Associa-tions with GWAS and Sequencing Data. Genetics, 2016, 203(2): 715-731.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(mvtnorm)
sigma = diag(0.9, 10) + 0.1
n = 50 # sample size
Z = rmvnorm(n=n, mean=rep(0,10), sigma=sigma)
X = rmvnorm(n=n, mean=rep(0,15), sigma=diag(1, 15))
Y = rmvnorm(n=n, mean=rep(0,15), sigma=diag(1, 15))
X = as.data.frame(cbind(Z[,1:5], X))
Y = as.data.frame(cbind(Z[,6:10], Y))
set.seed(123) # to ensure we can replicate the permutation P-value
p = 2; q = 2; n=50
X = rmvnorm(n=n, mean=rep(0,p), sigma=diag(1, p))
Y = rmvnorm(n=n, mean=rep(0,q), sigma=diag(1, q))
a = proc.time()
aSPC(X, Y, pow = c(1:8, Inf), B = 1000, method = "pearson")
proc.time() - a
#' a = proc.time()
aSPC(X, Y, pow = c(1:8, Inf), B = 1000, method = "spearman")
proc.time() - a
a = proc.time()
aSPC(X, Y, pow = c(1:8, Inf), B = 500, method = "dcor")
proc.time() - a
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.