MTest | R Documentation |
Performs Nashimoto-Wright's extended one-sided studentised range test against an ordered alternative for normal data with equal variances.
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"), ...)
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 |
alternative |
the alternative hypothesis. Defaults to |
formula |
a formula of the form |
data |
an optional matrix or data frame (or similar: see
|
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 |
The procedure uses the property of a simple order,
\theta_m' - \mu_m \le \mu_j - \mu_i \le \mu_l' - \mu_l
\qquad (l \le i \le m~\mathrm{and}~ m' \le j \le l')
.
The null hypothesis H_{ij}: \mu_i = \mu_j
is tested against
the alternative A_{ij}: \mu_i < \mu_j
for any
1 \le i < j \le k
.
The all-pairs comparisons test statistics for a balanced design are
\hat{h}_{ij} = \max_{i \le m < m' \le j} \frac{\left(\bar{x}_{m'} - \bar{x}_m \right)}
{s_{\mathrm{in}} / \sqrt{n}},
with n = n_i; ~ N = \sum_i^k n_i ~~ (1 \le i \le k)
, \bar{x}_i
the arithmetic mean of the i
th group,
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}_{ij} = \max_{i \le m < m' \le j} \frac{\left(\bar{x}_{m'} - \bar{x}_m \right)}
{s_{\mathrm{in}} \left(1/n_m + 1/n_{m'}\right)^{1/2}},
The null hypothesis is rejected, if \hat{h}_{ij} > h_{k,\alpha,v} / \sqrt{2}
.
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
).
a character string indicating what type of test was performed.
a character string giving the name(s) of the data.
the estimated statistic(s)
critical values for \alpha = 0.05
.
a character string describing the alternative hypothesis.
the parameter(s) of the test distribution.
a string that denotes the test distribution.
There are print and summary methods available.
The function will give a warning for the unbalanced case and returns the
critical value h_{k,\alpha,\infty} / \sqrt{2}
.
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.
osrtTest
, NPMTest
##
md <- aov(weight ~ group, PlantGrowth)
anova(md)
osrtTest(md)
MTest(md)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.