Title: | Causal Discovery for Categorical Data with Label Permutation |
---|---|
Description: | Discover causality for bivariate categorical data. This package aims to enable users to discover causality for bivariate observational categorical data. See Ni, Y. (2022) <arXiv:2209.08579> "Bivariate Causal Discovery for Categorical Data via Classification with Optimal Label Permutation. Advances in Neural Information Processing Systems 35 (in press)". |
Authors: | Yang Ni [aut, cre] |
Maintainer: | Yang Ni <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.0 |
Built: | 2024-11-22 03:20:01 UTC |
Source: | https://github.com/nystat/colp |
Cause-effect pairs extracted from R packages MASS and datasets for which the pairwise causal relationships are clear from the context, and at least one of the variables in each pair is categorical. For non-categorical variable, we discretized it at 5 evenly spaced quantiles.The current version contains 33 categorical cause-effect pairs.
data(CatPairs)
data(CatPairs)
A list of length 2. The first element is a list of 33 cause-effect pairs as data frames with the first column being the cause and the second column being the effect. The second element is a list of sources of each pair.
Estimate a causal directed acyclic graph (DAG) for ordinal cateogrical data with greedy or exhaustive search.
COLP(y, x, algo = "E")
COLP(y, x, algo = "E")
y |
factor, a potential effect variable |
x |
factor, a potential cause variable |
algo |
exhaustive search (algo="E") of category ordering or greedy search (algo="G") |
A list of length 3. cd = 1 if x causes y; cd = 0 otherwise. P is the optimal odering of the effect variable. epsilon is the difference in log-likelihood favoring x causes y.
fit = COLP(CatPairs[[1]][[1]]$Diffwt,CatPairs[[1]][[1]]$Treat,algo="E") fit$cd
fit = COLP(CatPairs[[1]][[1]]$Diffwt,CatPairs[[1]][[1]]$Treat,algo="E") fit$cd