Last data update: 2014.03.03

R: Four moments of Pearson correlation under permutation
getAkmomentR Documentation

Four moments of Pearson correlation under permutation

Description

The Pearson Correlation Coefficient can be derived by the correlation of scared feature matrix and clinical response. This function provides the first four moments under permutation of the scaled pearson correlation coefficient. In order to simplify the computation of moments summed over strata, an internal offset is applied to center each stratum levels.

Usage

getAkmoment(x,y)

Arguments

x

matrix (m x n)format.

y

clinical/experimental n-vector.

Details

Generates the first 4 moments of pearson correlation under permutation of A_k=∑_{iin I_k} x_i y_i. These steps are performed simultaneously for all m features.

Author(s)

Yi-Hui Zhou: yihui_zhou@ncsu.edu

References

Yi-Hui Zhou, Fred Wright, 2013, Fast And Robust Association Testing For High-Throughput Testing, Submitted.

See also the vignette included with this package.

See Also

getAmoment.

Examples

set.seed(1)
## simulate a data matrix with 300 rows and 30 columns
m=300
n=30
## assume x is a gene expression matrix with 300 genes, 30 samples
x=matrix(rnorm(m*n),m,n)
## y is the clinical response (continuous)
y=rnorm(n)
out=getAkmoment(x,y)
names(out)
out$final2[1:10]   ## the second moments for the first 10 genes

## y can also be dichotomuous 
y=c(rep(1,15),rep(2,15))
out.dia=getAkmoment(x,y)
out.dia$final4[1:10]

Results