Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

MTest

Extended One-Sided Studentised Range Test


Description

Performs Nashimoto-Wright's extended one-sided studentised range test against an ordered alternative for normal data with equal variances.

Usage

MTest(x, ...)

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

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

## S3 method for class 'aov'
MTest(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

The procedure uses the property of a simple order, θ_m' - μ_m ≤ μ_j - μ_i ≤ μ_l' - μ_l \qquad (l ≤ i ≤ m~\mathrm{and}~ m' ≤ j ≤ l'). The null hypothesis H_{ij}: μ_i = μ_j is tested against the alternative A_{ij}: μ_i < μ_j for any 1 ≤ i < j ≤ k.

The all-pairs comparisons test statistics for a balanced design are

SEE PDF

with n = n_i; ~ N = ∑_i^k n_i ~~ (1 ≤ i ≤ k), \bar{x}_i the arithmetic mean of the ith group, and s_{\mathrm{in}}^2 the within ANOVA variance. The null hypothesis is rejected, if \hat{h} > h_{k,α,v}, with v = N - k degree of freedom.

For the unbalanced case with moderate imbalance the test statistic is

SEE PDF

The null hypothesis is rejected, if \hat{h}_{ij} > h_{k,α,v} / √{2}.

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

Value

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 α = 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

The function will give a warning for the unbalanced case and returns the critical value h_{k,α,∞} / √{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.

Nashimoto, K., Wright, F.T., (2005) Multiple comparison procedures for detecting differences in simply ordered means. Comput. Statist. Data Anal. 48, 291–306.

See Also

Examples

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

PMCMRplus

Calculate Pairwise Multiple Comparisons of Mean Rank Sums Extended

v1.9.0
GPL (>= 3)
Authors
Thorsten Pohlert [aut, cre] (<https://orcid.org/0000-0003-3855-3025>)
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.