Jitao David Zhang
This repository offers practitioners of drug discovery and development reproducible tutorials for doing causal inference with Python and R. It accompanies a review article on the same topic which will be published soon.
The repository is shared with the CC-BY 4.0 license. The context is being actively updated. Feedback through issues and pull requests are welcome .
I thank Tom Michoel and Zhiwen Jiang for inspirations and discussions.
See 2021-11-dowhy.ipynb. The examples are taken from the documentations of the DoWhy package.
- How to work with DoWhy in four steps:
- Modelling
- Identification
- Estimation
- Refutation
- Working with DoWhy and EconML: an non-linear example
- DoWhy API for Pandas data frames
Create a conda environment using the environment.yml
file, install a new python kernel for Jupyter with the command below, and run the Jupyter notebook with the kernel.
conda activate causality
conda install -c conda-forge pip ipykernel
python -m ipykernel install --user --name causal --display-name "causality"
See 2021-12-CausalSalad.Rmd. The models are largely taken from the Causal Salad 2021 repository contributed by Richard McElreath.
See 2022-08-CausalModelSelectio.jmd. This tutorial explains and illustrates the principles of causal model selection in the analysis of molecular QTL data. The tutorial is written in julia using Weave.jl. If you are not familiar with julia, download or clone the contents of this repository and open the file 2022-08-CausalModelSelection.html in a browser. The code itself uses basic statistical and plotting functions, and should be easy to translate to other languages.