Estimates power for a given sample size, type I error level and number
of score components.
Usage
computePower(X, Y, A, n, seed = 123,
Nsim = 100, nperm = 200, alpha = 0.05,
scaling = 'auto-scaling', test = 'R2',
Y.prob = FALSE, eps = 0.01, post.transformation = TRUE,
fast = FALSE, transformation = 'clr', ncores = NULL)
Value
Returns a matrix of estimated power for each number of components and tests selected.
Arguments
X
Data matrix where columns represent the \(p\) variables and
rows the \(n\) observations.
Y
Data matrix where columns represent the two classes and
rows the \(n\) observations.
A
Number of score components
n
Sample size
seed
Seed value
Nsim
Number of simulations
nperm
Number of permutations
alpha
Type I error level
scaling
Type of scaling, one of
c('auto-scaling', 'pareto-scaling', 'mean-centering'). Default to 'auto-scaling'
test
Type of test statistic, one of c('score', 'mcc', 'R2'). Default to 'R2'.
Y.prob
Boolean value. Default FALSE. IF TRUEY is a probability vector
eps
Default 0.01. eps is used when Y.prob = FALSE to transform Y in a probability vector.
post.transformation
Boolean value. TRUE if you want to apply post transformation. Default to TRUE
fast
Use the function fk_density from the FKSUMR package for kernel density estimation. Default to FALSE.
transformation
Transformation used to map Y in probability data vector. The options are 'ilr' and 'clr'.
ncores
Number of cores, default NULL.
Author
Angela Andreella
References
For the general framework of power analysis for PLS-based methods see:
Andreella, A., Fino, L., Scarpa, B., & Stocchero, M. (2024). Towards a power analysis for PLS-based methods. arXiv preprint https://arxiv.org/abs/2403.10289.