Skip to contents

Builds the discrete rejection region under H0: p = 0.5 with size <= alpha, then evaluates power at the alternative p_alt.

Usage

morie_sign_test_power(x, mu0 = 0, p_alt = 0.7, alpha = 0.05)

Arguments

x

Numeric vector (only length(x != mu0) is used).

mu0

Null median.

p_alt

Alternative success probability P(X > mu0).

alpha

Test level.

Value

Named list: statistic (power), n, p_alt, alpha, size, k_lower, k_upper.

Examples

morie_sign_test_power(x = rnorm(50))
#> $statistic
#> [1] 0.7821938
#> 
#> $n
#> [1] 50
#> 
#> $p_alt
#> [1] 0.7
#> 
#> $alpha
#> [1] 0.05
#> 
#> $size
#> [1] 0.04887389
#> 
#> $k_lower
#> [1] 0
#> 
#> $k_upper
#> [1] 50
#> 
#> $method
#> [1] "Two-sided sign-test power function"
#>