siegel.test: Siegel-Tukey Test

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/siegel.test.R

Description

Performs the Siegel-Tukey test on data x and y, where ties are handled by averaging ranks, not by asymptotic approximations.

Usage

1
2
siegel.test(x, y, alternative = c("two.sided", "less", "greater"), reverse = FALSE, 
            all.perms = TRUE, num.sim = 20000)

Arguments

x

Numeric vector of data values.

y

Numeric vector of data values.

alternative

A character string specifying the alternative hypothesis, and must be one of "two.sided" (default), "greater" or "less". Only the initial letter needs to be specified.

reverse

Logical; If FALSE (default), then assign rank 1 to the smallest observation. If TRUE, then assign rank 1 to the largest observation.

all.perms

Logical. The exact p-value is attempted when all.perms (i.e., all permutations) is TRUE (default), and is simulated when all.perms is FALSE or when computing an exact p-value requires more than num.sim calculations.

num.sim

The upper limit on the number of permutations generated.

Details

Since the logical value of reverse may affect the p-value, yet neither logical value of reverse is preferred over the other, one should consider using ansari.test instead.

Value

alternative

Same as the input.

rank.x

The Siegel-Tukey ranks of the data x.

rank.y

The Siegel-Tukey ranks of the data y.

p.value

The p-value of the test.

Note

The formulas computed within siegel.test are based on the textbook by Higgins (2004).

Author(s)

Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA

References

Higgins, J. J. (2004) Introduction to Modern Nonparametric Statistics.

See Also

ansari.test, rmd.test, and perm.test

Examples

1
2
3
4
# The same data are used in the following two commands.

siegel.test( c(13, 34, 2, 19, 49, 63), c(17, 29, 22) )
siegel.test( c(13, 34, 2, 19, 49, 63), c(17, 29, 22), reverse=TRUE )

Example output

[[1]]
[1] "   Siegel-Tukey test"

$alternative
[1] "two.sided"

$rank.x
[1] 4 6 1 8 3 2

$rank.y
[1] 5 7 9

$p.value
[1] 0.1666667

[[1]]
[1] "   Siegel-Tukey test"

$alternative
[1] "two.sided"

$rank.x
[1] 3 5 2 7 4 1

$rank.y
[1] 6 8 9

$p.value
[1] 0.03571429

jmuOutlier documentation built on Aug. 6, 2019, 1:03 a.m.