kwsamplesize {MultNonParam}R Documentation

Sample Size for the Kruskal-Wallis test.

Description

kwsamplesize 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

kwsamplesize(shifts, distname = c("normal", "logistic"),
  targetpower = 0.8, proportions = rep(1,
  length(shifts))/length(shifts), level = 0.05, taylor = FALSE)

Arguments

shifts

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

distname

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

targetpower

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

proportions

The proportions in each group.

level

The test level.

taylor

Logical flag forcing the approximation of exceedence probabilities using the first derivative at zero.

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

kwpower(rep(10,3),c(0,1,2),"normal")

[Package MultNonParam version 1.2.8 Index]