power.usw: Power Calculation using the Univariate Shapiro-Wilk Test...

Description Usage Arguments Value References Examples

View source: R/function.R

Description

Empirical power calculation using univariate Shapiro-Wilk test statistic.

Usage

1
power.usw(a, n, p = 1, B = 1000, FUN, ...)

Arguments

a

significance level (α).

n

number of rows (observations).

p

p=1 for univariate.

B

number of Monte Carlo simulations, default is 1000 (can increase B to increase the precision).

FUN

self-defined function for generate multivariate distribution. See example.

...

optional arguments passed to FUN.

Value

Returns a numeric value of the estimated empirical power (value between 0 and 1).

References

Shapiro, S. S., & Wilk, M. B. (1965). An analysis of variance test for normality (complete samples). Biometrika, 52(3/4), 591-611.

Examples

1
2
3
4
5
6
set.seed(12345)

## Power calculation against univariate (p=1) independent Beta(1, 1) distribution ##
## at sample size n=50 at one-sided alpha = 0.05 ##

power.usw(a = 0.05, n = 50, p = 1,  B = 100, FUN=IMMV, D1=runif)

mvnormalTest documentation built on April 28, 2020, 5:06 p.m.