Revision 4d37ecce6b3f6a5469d23eeba965d7de2f5ca70f authored by Björn Böttcher on 13 September 2018, 14:20:06 UTC, committed by cran-robot on 13 September 2018, 14:20:06 UTC
1 parent 441d15d
independence.test.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/multivariance-functions.R
\name{independence.test}
\alias{independence.test}
\title{test for independence}
\usage{
independence.test(x, vec = 1:ncol(x), alpha = 0.05,
type = "distribution_free", verbose = TRUE, ...)
}
\arguments{
\item{x}{either a data matrix or an array of centered distance matrices}
\item{vec}{if x is a matrix, then this indicates which columns are treated together as one sample; if x is an array, these are the indexes for which the multivariance is calculated. The default is all columns and all indexes, respectively.}
\item{alpha}{significance level}
\item{type}{one of \code{"pearson_approx","distribution_free","resample"}}
\item{verbose}{logical, if TRUE meaningful text output is generated.}
\item{...}{these are passed to \code{\link{cdms}} (which is only invoked if \code{x} is a matrix)}
}
\value{
Returns \code{TRUE} if the hypothesis of independence is NOT rejected, otherwise \code{FALSE}.
}
\description{
This computes a test of independence for the columns of a sample matrix (required for the resampling test) or for given centered distance matrices (only possible for the distribution-free test).
}
\details{
The \code{"pearson_approx"} and \code{"resample"} are approximately sharp. The latter is based on a resampling approach and thus much slower. The \code{"distribution_free"} test might be very conservative.
The centered distance matrices can be prepared by \code{\link{cdms}}. But note that for the test based on Pearson's approximation and for the resample test, the data matrix has to be given.
}
\examples{
independence.test(coins(100)) #dependent sample which is 2-independent
independence.test(coins(100),type = "resample") #dependent sample which is 2-independent
independence.test(coins(100)[,2:3]) # independent sample
independence.test(coins(100)[,2:3],type = "resample") # independent sample
independence.test(coins(10),type = "resample") #dependent sample which is 2-independent
independence.test(coins(10)[,2:3],type = "resample") #dependent sample which is 2-independent
}
\references{
For the theoretic background see the references given on the main help page of this package: \link{multivariance-package}.
}
Computing file changes ...