\HeaderA{mood.test}{Mood Two-Sample Test of Scale}{mood.test}
\methaliasA{mood.test.default}{mood.test}{mood.test.default}
\methaliasA{mood.test.formula}{mood.test}{mood.test.formula}
\keyword{htest}{mood.test}
\begin{Description}\relax
Performs Mood's two-sample test for a difference in scale parameters.
\end{Description}
\begin{Usage}
\begin{verbatim}
mood.test(x, ...)

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

## S3 method for class 'formula':
mood.test(formula, data, subset, na.action, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x, y}] numeric vectors of data values.
\item[\code{alternative}] indicates the alternative hypothesis and must be
one of \code{"two.sided"} (default), \code{"greater"} or
\code{"less"} all of which can be abbreviated.
\item[\code{formula}] a formula of the form \code{lhs \textasciitilde{} rhs} where \code{lhs}
is a numeric variable giving the data values and \code{rhs} a factor
with two levels giving the corresponding groups.
\item[\code{data}] an optional matrix or data frame (or similar: see
\code{\LinkA{model.frame}{model.frame}}) containing the variables in the
formula \code{formula}.  By default the variables are taken from
\code{environment(formula)}.
\item[\code{subset}] an optional vector specifying a subset of observations
to be used.
\item[\code{na.action}] a function which indicates what should happen when
the data contain \code{NA}s.  Defaults to
\code{getOption("na.action")}.
\item[\code{...}] further arguments to be passed to or from methods.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The underlying model is that the two samples are drawn from
\eqn{f(x-l)}{} and \eqn{f((x-l)/s)/s}{}, respectively, where \eqn{l}{} is a
common location parameter and \eqn{s}{} is a scale parameter.

The null hypothesis is \eqn{s = 1}{}.

There are more useful tests for this problem.

In the case of ties, the formulation of Mielke (1967) is employed.
\end{Details}
\begin{Value}
A list with class \code{"htest"} containing the following components:
\begin{ldescription}
\item[\code{statistic}] the value of the test statistic.
\item[\code{p.value}] the p-value of the test.
\item[\code{alternative}] a character string describing the alternative
hypothesis.
\item[\code{method}] the character string \code{"Mood two-sample test of scale"}.
\item[\code{data.name}] a character string giving the names of the data.
\end{ldescription}
\end{Value}
\begin{References}\relax
William J. Conover (1971),
\emph{Practical nonparametric statistics}.
New York: John Wiley \& Sons.
Pages 234f.

Paul W. Mielke, Jr. (1967),
Note on some squared rank tests with existing ties.
\emph{Technometrics}, \bold{9}/2, 312--314.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{fligner.test}{fligner.test}} for a rank-based (nonparametric) k-sample
test for homogeneity of variances;
\code{\LinkA{ansari.test}{ansari.test}} for another rank-based two-sample test for a
difference in scale parameters;
\code{\LinkA{var.test}{var.test}} and \code{\LinkA{bartlett.test}{bartlett.test}} for parametric
tests for the homogeneity in variance.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## Same data as for the Ansari-Bradley test:
## Serum iron determination using Hyland control sera
ramsay <- c(111, 107, 100, 99, 102, 106, 109, 108, 104, 99,
            101, 96, 97, 102, 107, 113, 116, 113, 110, 98)
jung.parekh <- c(107, 108, 106, 98, 105, 103, 110, 105, 104,
            100, 96, 108, 103, 104, 114, 114, 113, 108, 106, 99)
mood.test(ramsay, jung.parekh)
## Compare this to ansari.test(ramsay, jung.parekh)
\end{ExampleCode}
\end{Examples}

