Estimates statistical significance of association between variables and their latent variables, estimated using a custom function.
1 2 3 
dat 
a data matrix with 
FUN 
optionally, provide a specfic function to estimate LVs. Must output 
r 
a number of significant latent variables. 
r1 
a numeric vector of latent variables of interest. 
s 
a number of “synthetic” null variables. Out of 
B 
a number of resampling iterations. 
covariate 
a model matrix of covariates with 
compute.obs 
a logical specifying to return observed statistics. By default, 
compute.null 
a logical specifying to return null statistics obtained by the jackstraw method. By default, 
compute.p 
a logical specifying to return pvalues. By default, 
verbose 
a logical specifying to print the computational progress. 
seed 
a seed for the random number generator. 
jackstraw
returns a list consisting of
p.value 

obs.stat 

null.stat 

Neo Christopher Chung nchchung@gmail.com
Chung and Storey (2013) Statistical Significance of Variables Driving Systematic Variation in HighDimensional Data. arXiv:1308.6013 [stat.ME] http://arxiv.org/abs/1308.6013
jackstraw
1 2 3 4 5 6 7 8 9 10  set.seed(1234)
## simulate data from a latent variable model: Y = BL + E
B = c(rep(1,50),rep(1,50), rep(0,900))
L = rnorm(20)
E = matrix(rnorm(1000*20), nrow=1000)
dat = B %*% t(L) + E
dat = t(scale(t(dat), center=TRUE, scale=TRUE))
## apply the jackstraw with the svd as a function
out = jackstraw.FUN(dat, FUN = function(x) svd(x)$v[,1,drop=FALSE], r=1, s=100, B=50)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.