View source: R/jackstraw_rpca.R
jackstraw_rpca | R Documentation |
Test association between the observed variables and their latent variables captured by principal components (PCs). PCs are computed by randomized Singular Value Decomposition (see rsvd
).
jackstraw_rpca(
dat,
r = NULL,
r1 = NULL,
s = NULL,
B = NULL,
covariate = NULL,
verbose = TRUE,
...
)
dat |
a data matrix with |
r |
a number (a positive integer) of significant principal components. See permutationPA and other methods. |
r1 |
a numeric vector of principal components of interest. Choose a subset of |
s |
a number (a positive integer) of “synthetic” null variables. Out of |
B |
a number (a positive integer) of resampling iterations. There will be a total of |
covariate |
a data matrix of covariates with corresponding |
verbose |
a logical specifying to print the computational progress. |
... |
additional arguments to |
This function computes m
p-values of linear association between m
variables and their PCs.
Its resampling strategy accounts for the over-fitting characteristics due to direct computation of PCs from the observed data
and protects against an anti-conservative bias.
Provide the data matrix, with m
variables as rows and n
observations as columns.
Given that there are r
significant PCs, this function tests for linear association between
m
variables and their r
PCs.
You could specify a subset of significant PCs that you are interested in (r1
). If r1
is given,
then this function computes statistical significance of association between m
variables and r1
,
while adjusting for other PCs (i.e., significant PCs that are not your interest).
For example, if you want to identify variables associated with first and second PCs,
when your data contains three significant PCs, set r=3
and r1=c(1,2)
.
Please take a careful look at your data and use appropriate graphical and statistical criteria
to determine a number of significant PCs, r
. The number of significant PCs depends on the data structure and the context.
In a case when you fail to specify r
, it will be estimated from a permutation test (Buja and Eyuboglu, 1992)
using a function permutationPA.
If s
is not supplied, s
is set to about 10% of m
variables.
If B
is not supplied, B
is set to m*10/s
.
jackstraw_rpca
returns a list consisting of
p.value |
|
obs.stat |
|
null.stat |
|
Neo Christopher Chung nchchung@gmail.com
Chung and Storey (2015) Statistical significance of variables driving systematic variation in high-dimensional data. Bioinformatics, 31(4): 545-554 \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/bioinformatics/btu674")}
jackstraw jackstraw_subspace permutationPA
## simulate data from a latent variable model: Y = BL + E
B = c(rep(1,10),rep(-1,10), rep(0,180))
L = rnorm(20)
E = matrix(rnorm(200*20), nrow=200)
dat = B %*% t(L) + E
dat = t(scale(t(dat), center=TRUE, scale=TRUE))
## apply the jackstraw
out = jackstraw_rpca(dat, r=1)
## Use optional arguments
## For example, set s and B for a balance between speed of the algorithm and accuracy of p-values
## Not run:
## out = jackstraw_rpca(dat, r=1, s=10, B=200)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.