Learn R Programming

powerPLS (version 0.2.1)

computeSampleSize: Sample size estimation

Description

Compute optimal sample size

Usage

computeSampleSize(n, X, Y, A, alpha, beta,
nperm, Nsim, seed, test = 'R2',...)

Value

Returns a data frame that contains the estimated power for each sample size and number of components considered

Arguments

n

Vector of sample sizes to consider

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

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 c('score', 'mcc', 'R2'). Default to 'R2'.

...

Further parameters.

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.

See Also

computePower

Examples

Run this code
if (FALSE) {
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')
}

Run the code above in your browser using DataLab