wil2powsim: Wilcox Power Simulation

Description Usage Arguments Value References Examples

Description

Iterates over specified number of simulations. At each step, generate independent samples, compute each test statistic, and record whether or not each test rejected. For each test, its empirical power is its number of rejections divided by the number of simulations. See section 10.4.4 on page 605 of the book.

Usage

1
wil2powsim(n1, n2, nsims, eps, vc, Delta = 0, alpha = 0.05)

Arguments

n1

Sample size 1.

n2

Sample size 2. This value must be divisible by the number of elements in vector Delta.

nsims

Number of iterations (simulations).

eps

Contamination rate (epsilon).

vc

Standard deviation of contaminated part.

Delta

Vector of shifts in location between models. Sample size 2 (n2) must be divisible by the number of ekements in this vector.

alpha

Level of significance of the test.

Value

Vector containing empirical power of MWW test and t-test.

References

Hogg, R. McKean, J. Craig, A (2018) Introduction to Mathematical Statistics, 8th Ed. Boston: Pearson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Example where variables are initialized
# then passed into function.
n1 <- 30
n2 <- 30
nsims <- 100
eps <- 0.2
vc <- 10
Delta <- c(-3, 3, 1)
alpha <- 0.25
results <- wil2powsim(n1, n2, nsims, eps, vc, Delta, alpha)


# Example where values are passed directly
# into function, along with a default param
# override for the Delta param.
results <- wil2powsim(30, 30, 100, 0.20, 10, c(-3, 3, 1), 0.25)

austinragotzy/mathstat documentation built on May 13, 2019, 11:30 a.m.