kwpower {MultNonParam}R Documentation

Power for the Kruskal-Wallis test.

Description

kwpower approximates power for the Kruskal-Wallis test, using a chi-square approximation under the null, and a non-central chi-square approximation under the alternative. The noncentrality parameter is calculated using alternative means and the null variance structure.

Usage

kwpower(
  nreps,
  shifts,
  distname = c("normal", "cauchy", "logistic"),
  level = 0.05,
  mc = 0,
  taylor = FALSE
)

Arguments

nreps

The numbers in each group.

shifts

The offsets for the various populations, under the alternative hypothesis.

distname

The distribution of the underlying observations; normal, cauchy, and logistic are currently supported.

level

The test level.

mc

0 for asymptotic calculation, or positive for mc approximation.

taylor

logical determining whether Taylor series approximation is used for probabilities.

Details

The standard noncentral chi-square power formula, or Monte Carlo, is used.

Value

A list with components power, giving the power approximation, ncp, giving the noncentrality parameter, cv, giving the critical value, probs, giving the intermediate output from pairwiseprobability, and expect, the quantities summed before squaring in the noncentrality parameter.

Examples

#Calculate the power for the Kruskal Wallis test for normal observations,
#10 observations in each of three groups, with groups centered at 0, 1, 2.
#Level is 0.05 by default.
kwpower(rep(10,3),c(0,1,2),"normal")

[Package MultNonParam version 1.3.9 Index]