GSTTest: Generalized Siegel-Tukey Test of Homogeneity of Scales

View source: R/GSTTest.R

GSTTestR Documentation

Generalized Siegel-Tukey Test of Homogeneity of Scales

Description

Performs a Siegel-Tukey k-sample rank dispersion test.

Usage

GSTTest(x, ...)

## Default S3 method:
GSTTest(x, g, dist = c("Chisquare", "KruskalWallis"), ...)

## S3 method for class 'formula'
GSTTest(
  formula,
  data,
  subset,
  na.action,
  dist = c("Chisquare", "KruskalWallis"),
  ...
)

Arguments

x

a numeric vector of data values, or a list of numeric data vectors.

...

further arguments to be passed to or from methods.

g

a vector or factor object giving the group for the corresponding elements of "x". Ignored with a warning if "x" is a list.

dist

the test distribution. Defaults's to "Chisquare".

formula

a formula of the form response ~ group where response gives the data values and group a vector or factor of the corresponding groups.

data

an optional matrix or data frame (or similar: see model.frame) containing the variables in the formula formula. By default the variables are taken from environment(formula).

subset

an optional vector specifying a subset of observations to be used.

na.action

a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action").

Details

Meyer-Bahlburg (1970) has proposed a generalized Siegel-Tukey rank dispersion test for the k-sample case. Likewise to the fligner.test, this test is a nonparametric test for testing the homogegeneity of scales in several groups. Let \theta_i, and \lambda_i denote location and scale parameter of the ith group, then for the two-tailed case, the null hypothesis H: \lambda_i / \lambda_j = 1 | \theta_i = \theta_j, ~ i \ne j is tested against the alternative, A: \lambda_i / \lambda_j \ne 1 with at least one inequality beeing strict.

The data are combinedly ranked according to Siegel-Tukey. The ranking is done by alternate extremes (rank 1 is lowest, 2 and 3 are the two highest, 4 and 5 are the two next lowest, etc.).

Meyer-Bahlburg (1970) showed, that the Kruskal-Wallis H-test can be employed on the Siegel-Tukey ranks. The H-statistic is assymptotically chi-squared distributed with v = k - 1 degree of freedom, the default test distribution is consequently dist = "Chisquare". If dist = "KruskalWallis" is selected, an incomplete beta approximation is used for the calculation of p-values as implemented in the function pKruskalWallis of the package SuppDists.

Value

A list with class "htest" containing the following components:

method

a character string indicating what type of test was performed.

data.name

a character string giving the name(s) of the data.

statistic

the estimated quantile of the test statistic.

p.value

the p-value for the test.

parameter

the parameters of the test statistic, if any.

alternative

a character string describing the alternative hypothesis.

estimates

the estimates, if any.

null.value

the estimate under the null hypothesis, if any.

Note

If ties are present, a tie correction is performed and a warning message is given. The GSTTest is sensitive to median differences, likewise to the Siegel-Tukey test. It is thus appropriate to apply this test on the residuals of a one-way ANOVA, rather than on the original data (see example).

References

H.F.L. Meyer-Bahlburg (1970), A nonparametric test for relative spread in k unpaired samples, Metrika 15, 23–29.

See Also

fligner.test, pKruskalWallis, Chisquare, fligner.test

Examples

GSTTest(count ~ spray, data = InsectSprays)

## as means/medians differ, apply the test to residuals
## of one-way ANOVA
ans <- aov(count ~ spray, data = InsectSprays)
GSTTest( residuals( ans) ~ spray, data =InsectSprays)


PMCMRplus documentation built on May 29, 2024, 8:34 a.m.