Description Usage Arguments Details Value References Examples
View source: R/multivariance-functions.R
Depreciated. Use multivariance.test
instead. It provides all options and returns test result in a standard R format.
1 2 3 4 5 6 7 8 | independence.test(
x,
vec = 1:ncol(x),
alpha = 0.05,
type = "distribution_free",
verbose = TRUE,
...
)
|
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 |
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.
Returns TRUE
if the hypothesis of independence is NOT rejected, otherwise FALSE
.
For the theoretic background see the references given on the main help page of this package: multivariance-package.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.