CRAN status

CausalQueries is a package that lets you declare binary causal models, update beliefs about causal types given data and calculate arbitrary estimands. Model definition makes use of dagitty functionality. Updating is implemented in stan.


To install the latest stable release of CausalQueries:


To install the latest development release :


Causal models

Causal models are defined by:

A wrinkle:


Our goal is to form beliefs over parameters but also over more substantive estimands:

Credits etc

The approach used in CausalQueries is developed in Humphreys and Jacobs 2023 drawing on work on probabilistic causal models described in Pearl’s Causality (Pearl, 2009). We thank Ben Goodrich who provided generous insights on using stan for this project. We thank Alan M Jacobs for key work developing the framework underlying the package. Our thanks to Jasper Cooper for contributions generating a generic function to create Stan code, to Clara Bicalho who helped figure out the syntax for causal statements, to Julio S. Solís Arce who made many key contributions figuring out how to simplify the specification of priors, and to Merlin Heidemanns who figured out the rstantools integration and made myriad code improvements.