independence.test {multivariance} | R Documentation |
test for independence
Description
Depreciated. Use multivariance.test
instead. It provides all options and returns test result in a standard R format.
Usage
independence.test(
x,
vec = 1:ncol(x),
alpha = 0.05,
type = "distribution_free",
verbose = TRUE,
...
)
Arguments
x |
either a data matrix or a list of doubly centered distance matrices |
vec |
if x is a matrix, then this indicates which columns are treated together as one sample; if x is a list, these are the indexes for which the multivariance is calculated. The default is all columns and all indexes, respectively. |
alpha |
significance level |
type |
one of |
verbose |
logical, if TRUE meaningful text output is generated. |
... |
these are passed to |
Details
This computes a test of independence for the columns of a sample matrix (required for the resampling test) or for given doubly centered distance matrices (only possible for the distribution-free test).
The "pearson_approx"
and "resample"
are approximately sharp. The latter is based on a resampling approach and thus much slower. The "distribution_free"
test might be very conservative.
The doubly centered distance matrices can be prepared by cdms
. But note that for the test based on Pearson's approximation and for the resampling test, the data matrix has to be given.
Value
Returns TRUE
if the hypothesis of independence is NOT rejected, otherwise FALSE
.
References
For the theoretic background see the references given on the main help page of this package: multivariance-package.
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