Skip to contents

Simulates samples of size length(x) from Normal(effect_size, 1) and reports the rejection rate of two-sided wilcox.test at level alpha.

Usage

morie_wilcoxon_power(x, effect_size = 0.5, alpha = 0.05, nsim = 2000, seed = 0)

Arguments

x

Numeric vector (only length(x) is used).

effect_size

Location shift under H1.

alpha

Test level.

nsim

Replicates.

seed

Reproducibility seed (NULL = no fix).

Value

Named list: statistic (power), n, effect_size, alpha, nsim, se.

Examples

morie_wilcoxon_power(x = rnorm(50))
#> $statistic
#> [1] 0.919
#> 
#> $n
#> [1] 50
#> 
#> $effect_size
#> [1] 0.5
#> 
#> $alpha
#> [1] 0.05
#> 
#> $nsim
#> [1] 2000
#> 
#> $se
#> [1] 0.006100779
#> 
#> $method
#> [1] "Wilcoxon signed-rank power (Monte Carlo)"
#>