dSepCheck: Conditional independence check

Description Usage Arguments Details Value Note References See Also Examples

View source: R/cibn.r

Description

Check conditional independence between two variables based on the d-separation criterion.

Usage

1
dSepCheck(x, var1, var2, given = NULL)

Arguments

x

An object of class cibn.

var1

The name of the first variable.

var2

The name of the second variable.

given

A vector containing the names of conditioning variables. If NULL, marginal independence is checked.

Details

The d-separation is a necessary and sufficient condition for conditional independence. See Pearl (2000), page 16 and following).

Value

Logical

Note

The result is unchanged if arguments var1 and var2 are switched.

Dependence is a necessary but not sufficient condition for causation: see the discussion in Pearl (2000).

References

J. Pearl (2000). Causality: models, reasoning, and inference. Cambridge University Press. Cambridge, UK. ISBN: 978-0-521-89560-6

See Also

new.cibn.

Examples

1
2
3
4
5
6
data(bankrisk_code)
bankrisk_bn <- new.cibn(bankrisk_code)
#
dSepCheck(bankrisk_bn, var1="Age", var2="Edu")
dSepCheck(bankrisk_bn, var1="Portf", var2="Edu", given="Risk")
dSepCheck(bankrisk_bn, var1="Portf", var2="Edu", given=c("Risk","Life"))

alessandromagrini/cibn documentation built on Feb. 7, 2022, 10:55 p.m.