rrod.test: Robust Rank-Order Distributional Test

View source: R/rrod.test.R

rrod.testR Documentation

Robust Rank-Order Distributional Test

Description

Performs Fligner-Pollicello robust rank-order distributional test for location.

Usage

rrod.test(x, ...)

## Default S3 method:
rrod.test(x, y, alternative = c("two.sided", "less", "greater"), ...)

## S3 method for class 'formula'
rrod.test(formula, data, subset, na.action, ...)

Arguments

x

a vector of data values.

...

further arguments to be passed to or from methods.

y

an optional numeric vector of data values.

alternative

the alternative hypothesis. Defaults to "two.sided".

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 non-parametric RROD two-sample test can be used to test for differences in location, whereas it does not assume variance homogeneity.

Let X and Y denote two samples with sizes n_x and n_y of a continuous variable.First, the combined sample is transformed into ranks in increasing order. Let S_{xi} and S_{yj} denote the counts of Y (X) values having a lower rank than x_i (y_j). The mean counts are:

\bar{S}_x = \sum_{i=1}^{n_x} S_{xi} / n_x

\bar{S}_y = \sum_{j=1}^{n_y} S_{yj} / n_y

The variances are:

s^2_{Sx} = \sum_{i=1}^{n_x} \left( S_{xi} - \bar{S}_x \right)^2

s^2_{Sy} = \sum_{j=1}^{n_y} \left( S_{yj} - \bar{S}_y \right)^2

The test statistic is:

z = \frac{1}{2}~ \frac{n_x \bar{S}_x - n_y \bar{S}_y} {\left( \bar{S}_x \bar{S}_y + s^2_{Sx} + s^2_{Sy} \right)^{1/2}}

The two samples have significantly different location parameters, if |z| > z_{1-\alpha/2}. The function calculates the p-values of the null hypothesis for the selected alternative than can be "two.sided", "greater" or "less".

Value

A list with class "htest".

References

Fligner, M. A., Pollicello, G. E. III. (1981), Robust Rank Procedures for the Behrens-Fisher Problem, Journal of the American Statistical Association, 76, 162–168.

Lanzante, J. R. (1996), Resistant, robust and non-parametric techniques for the analysis of climate data: Theory and examples, including applications to historical radiosonde station data, Int. J. Clim., 16, 1197–1226.

Siegel, S. and Castellan, N. (1988), Nonparametric Statistics For The Behavioural Sciences, New York: McCraw-Hill.

See Also

wilcox.test

Examples

## Two-sample test.
## Hollander & Wolfe (1973), 69f.
## Permeability constants of the human chorioamnion (a placental
##  membrane) at term (x) and between 12 to 26 weeks gestational
##  age (y).  The alternative of interest is greater permeability
##  of the human chorioamnion for the term pregnancy.
x <- c(0.80, 0.83, 1.89, 1.04, 1.45, 1.38, 1.91, 1.64, 0.73, 1.46)
y <- c(1.15, 0.88, 0.90, 0.74, 1.21)
rrod.test(x, y, alternative = "g")

## Formula interface.
boxplot(Ozone ~ Month, data = airquality)
rrod.test(Ozone ~ Month, data = airquality,
            subset = Month %in% c(5, 8)) 

trend documentation built on Oct. 10, 2023, 9:06 a.m.