ciTest-comma-DDDataSet-dash-method: Do conditional independence test on DDDataSet...

Description Usage Arguments Details Value Examples

Description

Do conditional independence test on DDDataSet

Usage

1
2
## S4 method for signature 'DDDataSet'
ciTest(obj, var1, var2, cond, test.type="mc-x2-c", B, min.table.size, ...)

Arguments

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

Details

This function does a conditional independence var1 indep var2 | cond. The following test types are available (implemented by package bnlearn).

For binary data:

For continuous data:

Value

CITestResult object with the result of the test

Examples

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")

ddgraph documentation built on Nov. 17, 2017, 10:50 a.m.