Identification of Counterfactual Queries in Causal Models
Overview
Facilitates the identification of counterfactual queries in structural causal models via the ID* and IDC* algorithms by Shpitser, I. and Pearl, J. (2007, 2008) doi:10.48550/arXiv.1206.5294, https://jmlr.org/papers/v9/shpitser08a.html. Provides a simple interface for defining causal diagrams and counterfactual conjunctions. Construction of parallel worlds graphs and counterfactual graphs is carried out automatically based on the counterfactual query and the causal diagram. See Tikka, S. (2023) doi:10.32614/RJ-2023-053 for a tutorial of the package.
- Fixed an issue where some identifiable queries were incorrectly deemed nonidentifiable when multiple counterfactual variables shared a compatible subscript.
- Updated
igraphrelated functionality to use non-deprecated functions.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 10includes a package overview page
- Examples that run
- 100%4 run in a plain check
- Exported functions with examples
- 50%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 10%
Downloads
Repository
5 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/santikka/cfid on 2026-10-22.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Installing cfid adds no packages beyond those that come with R.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 0.1.8Latest
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 0.1.72023-11-27 · diff ↗
- 0.1.62023-11-13 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 0.1.42022-10-26 · diff ↗ ·
removed 3 exports
CounterfactualConjunction, CounterfactualVariable, Probabilityadded 5 exports
causal_effect, counterfactual_conjunction, counterfactual_variable, functional, probability - RR 4.2.0 released · 2022-04-22
- 0.1.22021-06-10
- RR 4.1.0 released · 2021-05-18
Package metadata
- First published
- 2021-06-10
- Total releases
- 5 / 5 yrs
- License
- GPL (>= 3) OSI
- Download size
- 39 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("cfid")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.