osrtTest: One-Sided Studentized Range Test

View source: R/osrtTest.R

osrtTestR Documentation

One-Sided Studentized Range Test

Description

Performs Hayter's one-sided studentized range test against an ordered alternative for normal data with equal variances.

Usage

osrtTest(x, ...)

## Default S3 method:
osrtTest(x, g, alternative = c("greater", "less"), ...)

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

## S3 method for class 'aov'
osrtTest(x, alternative = c("greater", "less"), ...)

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

Hayter's one-sided studentized range test (OSRT) can be used for testing several treatment levels with a zero control in a balanced one-factorial design with normally distributed variables that have a common variance. The null hypothesis, H: \mu_i = \mu_j ~~ (i < j) is tested against a simple order alternative, A: \mu_i < \mu_j, with at least one inequality being strict.

The test statistic is calculated as,

\hat{h} = \max_{1 \le i < j \le k} \frac{ \left(\bar{x}_j - \bar{x}_i \right)} {s_{\mathrm{in}} / \sqrt{n}},

with k the number of groups, n = n_1, n_2, \ldots, n_k and s_{\mathrm{in}}^2 the within ANOVA variance. The null hypothesis is rejected, if \hat{h} > h_{k,\alpha,v}, with v = N - k degree of freedom.

For the unbalanced case with moderate imbalance the test statistic is

\hat{h} = \max_{1 \le i < j \le k} \frac{ \left(\bar{x}_j - \bar{x}_i \right)} {s_{\mathrm{in}} \sqrt{1/n_j + 1/n_i}},

The function does not return p-values. Instead the critical h-values as given in the tables of Hayter (1990) for \alpha = 0.05 (one-sided) are looked up according to the number of groups (k) and the degree of freedoms (v). Non tabulated values are linearly interpolated with the function approx.

Value

A list with class "osrt" that contains 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 statistic(s)

crit.value

critical values for \alpha = 0.05.

alternative

a character string describing the alternative hypothesis.

parameter

the parameter(s) of the test distribution.

dist

a string that denotes the test distribution.

There are print and summary methods available.

Note

Hayter (1990) has tabulated critical h-values for balanced designs only. For some unbalanced designs some k = 3 critical h-values can be found in Hayter et al. 2001. ' The function will give a warning for the unbalanced case and returns the critical value h_{k,\alpha,v} / \sqrt{2}.

References

Hayter, A. J.(1990) A One-Sided Studentised Range Test for Testing Against a Simple Ordered Alternative, Journal of the American Statistical Association 85, 778–785.

Hayter, A.J., Miwa, T., Liu, W. (2001) Efficient Directional Inference Methodologies for the Comparisons of Three Ordered Treatment Effects. J Japan Statist Soc 31, 153–174.

See Also

link{hayterStoneTest} MTest

Examples

##
md <- aov(weight ~ group, PlantGrowth)
anova(md)
osrtTest(md)
MTest(md)

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