independence.test: test for independence

Description Usage Arguments Details Value References Examples

View source: R/multivariance-functions.R

Description

Depreciated. Use multivariance.test instead. It provides all options and returns test result in a standard R format.

Usage

1
2
3
4
5
6
7
8
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 "pearson_approx","distribution_free","resample"

verbose

logical, if TRUE meaningful text output is generated.

...

these are passed to cdms (which is only invoked if x is a matrix)

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

1
2
3
4
5
6
7
8
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

multivariance documentation built on Oct. 6, 2021, 5:08 p.m.