50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

PMCMRplus (version 1.9.10)

shanTest: Testing against Ordered Alternatives (Shan-Young-Kang Test)

Description

Performs the Shan-Young-Kang test for testing against ordered alternatives.

Usage

shanTest(x, ...)

# S3 method for default shanTest(x, g, alternative = c("greater", "less"), ...)

# S3 method for formula shanTest( formula, data, subset, na.action, alternative = c("greater", "less"), ... )

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.

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.

alternative

the alternative hypothesis. Defaults to "greater".

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

The null hypothesis, H0:θ1=θ2==θk is tested against a simple order hypothesis, HA:θ1θ2θk, θ1<θk.

Let Rij be the rank of Xij, where Xij is jointly ranked from {1,2,,N},  N=i=1kni, the the test statistic is

S=i=1k1j=i+1kDij,

with Dij=l=1nim=1nj(RjmRil) I(Xjm>Xil),

where

I(u)={1, u>00, u0.

The test statistic is asymptotically normal distributed: z=SμSsS2

The p-values are estimated from the standard normal distribution.

References

Shan, G., Young, D., Kang, L. (2014) A New Powerful Nonparametric Rank Test for Ordered Alternative Problem. PLOS ONE 9, e112924. https://doi.org/10.1371/journal.pone.0112924

See Also

kruskalTest and shirleyWilliamsTest of the package PMCMRplus, kruskal.test of the library stats.

Examples

Run this code
## Example from Sachs (1997, p. 402)
x <- c(106, 114, 116, 127, 145,
       110, 125, 143, 148, 151,
       136, 139, 149, 160, 174)
g <- gl(3,5)
levels(g) <- c("A", "B", "C")

## Chacko's test
chackoTest(x, g)

## Cuzick's test
cuzickTest(x, g)

## Johnson-Mehrotra test
johnsonTest(x, g)

## Jonckheere-Terpstra test
jonckheereTest(x, g)

## Le's test
leTest(x, g)

## Spearman type test
spearmanTest(x, g)

## Murakami's BWS trend test
bwsTrendTest(x, g)

## Fligner-Wolfe test
flignerWolfeTest(x, g)

## Shan-Young-Kang test
shanTest(x, g)

Run the code above in your browser using DataLab