computeSampleSize: Sample size estimation

View source: R/computeSampleSize.R

computeSampleSizeR Documentation

Sample size estimation

Description

Compute optimal sample size

Usage

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

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.

Value

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

Author(s)

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

## 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)

powerPLS documentation built on April 4, 2025, 1:57 a.m.