swh:1:snp:813359ba77493c9d5dd1abad9a1f53490a8abf57
Tip revision: b1d73278a87bcb94c00cedbbaff294f96e71bbf0 authored by Torsten Hothorn on 13 April 2010, 00:00:00 UTC
version 1.0-11
version 1.0-11
Tip revision: b1d7327
SpearmanTest.Rd
\name{SpearmanTest}
\alias{spearman_test}
\alias{spearman_test.formula}
\alias{spearman_test.IndependenceProblem}
\title{ Spearman's Test on Independence }
\description{
Testing the independence of two numeric variables.
}
\usage{
\method{spearman_test}{formula}(formula, data, subset = NULL, weights = NULL, \dots)
\method{spearman_test}{IndependenceProblem}(object,
distribution = c("asymptotic", "approximate"), ...)
}
\arguments{
\item{formula}{a formula of the form \code{y ~ x | block} where \code{y}
and \code{x} are numeric variables and \code{block} is an
optional factor for stratification.}
\item{data}{an optional data frame containing the variables in the
model formula.}
\item{subset}{an optional vector specifying a subset of observations
to be used.}
\item{weights}{an optional formula of the form \code{~ w} defining
integer valued weights for the observations.}
\item{object}{an object of class \code{IndependenceProblem}.}
\item{distribution}{a character, the null distribution of the test statistic
can be approximated by its
\code{asymptotic} distribution (\code{asymptotic})
or via Monte-Carlo resampling (\code{approximate}).
Alternatively, the functions
\code{\link{approximate}} or \code{\link{asymptotic}} can be
used to specify how the exact conditional distribution of the test statistic
should be approximated.}
\item{\dots}{further arguments to be passed to or from methods.}
}
\details{
The null hypothesis of the independence of \code{y} and \code{x}
is tested.
}
\value{
An object inheriting from class \code{\link{IndependenceTest-class}} with
methods \code{\link{show}}, \code{\link{statistic}}, \code{\link{expectation}},
\code{\link{covariance}} and \code{\link{pvalue}}. The null distribution
can be inspected by \code{\link{pperm}}, \code{\link{dperm}},
\code{\link{qperm}} and \code{\link{support}} methods.
}
\examples{
spearman_test(CONT ~ INTG, data = USJudgeRatings)
}
\keyword{htest}