Description Usage Arguments Details Value Examples
Do conditional independence test on DDDataSet
1 2 |
obj |
DDDataSet object on which (conditional) independence test needs to be done |
var1 |
the name or index of the first variable to be tested |
var2 |
the name or index of the second variable |
cond |
the names or indexes of variables to condition on (defaults to NULL) |
test.type |
the type of statistical test (defaults to mc-x2) |
B |
the number of replicates for MC-based tests (default to NULL) |
min.table.size |
the minimal number of samples in a contingency table per conditioning set (makes sense only for discrete data) |
... |
unused |
This function does a conditional independence var1 indep var2 | cond. The following
test types are available (implemented by package bnlearn
).
For binary data:
"fisher" - Fisher's exact test (only for unconditional independence)
"mi" - Mutual Information (discrete)
"mi-sh" - Mutual Information (discrete, shrinkage)
"mc-mi" - Mutual Information (discrete, Monte Carlo)
"aict" - AIC-like Test
"x2" - Pearson's X^2
"mc-x2" - Pearson's X^2 (Monte Carlo)
"mc-x2-c" - Pearson's X^2 (Monte Carlo) the corrected version
"g2" - G^2 test (requires pcalg package)
For continuous data:
"mi-g" - Mutual Information (Gaussian)
"mi-g-sh" - Mutual Information (Gaussian, shrinkage)
"mc-mi-g" - Mutual Information (Gaussian, Monte Carlo)
"cor" - Pearson's Linear Correlation
"mc-cor" - Pearson's Linear Correlation (Monte Carlo)
"zf" - Fisher's Z Test
"mc-zf" - Fisher's Z Test (Monte Carlo)
CITestResult object with the result of the test
1 2 3 4 5 6 7 | data(mesoBin)
# test if tin_4.6 is independent of class labels
ciTest(mesoBin$Meso, "Tin 4-6h", "class")
# test if tin_4.6 is independent of class conditioned on twi_2.4
ciTest(mesoBin$Meso, "Tin 4-6h", "class", "Twi 2-4h")
# repeat the test using G2 asymptotic distribution
ciTest(mesoBin$Meso, "Tin 4-6h", "class", "Twi 2-4h", test.type="g2")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.