Performs a Siegel-Tukey k-sample rank dispersion test.
GSTTest(x, ...)# S3 method for default
GSTTest(x, g, dist = c("Chisquare", "KruskalWallis"), ...)
# S3 method for formula
GSTTest(
formula,
data,
subset,
na.action,
dist = c("Chisquare", "KruskalWallis"),
...
)
a numeric vector of data values, or a list of numeric data vectors.
further arguments to be passed to or from methods.
a vector or factor object giving the group for the
corresponding elements of "x"
.
Ignored with a warning if "x"
is a list.
the test distribution. Defaults's to "Chisquare"
.
a formula of the form response ~ group
where
response
gives the data values and group
a vector or
factor of the corresponding groups.
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)
.
an optional vector specifying a subset of observations to be used.
a function which indicates what should happen when
the data contain NA
s. Defaults to getOption("na.action")
.
A list with class "htest"
containing the following components:
a character string indicating what type of test was performed.
a character string giving the name(s) of the data.
the estimated quantile of the test statistic.
the p-value for the test.
the parameters of the test statistic, if any.
a character string describing the alternative hypothesis.
the estimates, if any.
the estimate under the null hypothesis, if any.
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 \(i\)th 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.
H.F.L. Meyer-Bahlburg (1970), A nonparametric test for relative spread in k unpaired samples, Metrika 15, 23--29.
# NOT RUN {
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)
# }
Run the code above in your browser using DataLab