View source: R/computeSampleSize.R
computeSampleSize | R Documentation |
Compute optimal sample size
computeSampleSize(n, X, Y, A, alpha, beta,
nperm, Nsim, seed, test = 'R2',...)
n |
Vector of sample sizes to consider |
X |
Data matrix where columns represent the |
Y |
Data matrix where columns represent the two classes and
rows the |
A |
Number of score components |
alpha |
Type I error level. Default to 0.05 |
beta |
Type II error level. Default to 0.2. |
nperm |
Number of permutations. Default to 100. |
Nsim |
Number of simulations. Default to 100. |
seed |
Seed value |
test |
Type of test, one of |
... |
Further parameters. |
Returns a data frame that contains the estimated power for each sample size and number of components considered
Angela Andreella
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.
computePower
## Not run:
datas <- simulatePilotData(nvar = 10, clus.size = c(5,5),m = 6,nvar_rel = 5,A = 2)
out <- computeSampleSize(X = datas$X, Y = datas$Y, A = 2, A = 3, n = 20, test = 'R2')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.