{"id":13427043,"url":"https://github.com/jrfiedler/causal_inference_python_code","last_synced_at":"2025-05-16T06:07:32.781Z","repository":{"id":38360644,"uuid":"120231078","full_name":"jrfiedler/causal_inference_python_code","owner":"jrfiedler","description":"Python code for part 2 of the book Causal Inference: What If, by Miguel Hernán and James Robins","archived":false,"fork":false,"pushed_at":"2022-01-08T02:29:18.000Z","size":1579,"stargazers_count":1301,"open_issues_count":1,"forks_count":392,"subscribers_count":52,"default_branch":"master","last_synced_at":"2025-04-08T16:06:05.187Z","etag":null,"topics":["causal-inference","causality","data-science","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jrfiedler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-04T23:00:19.000Z","updated_at":"2025-04-07T13:03:52.000Z","dependencies_parsed_at":"2022-07-14T04:00:35.184Z","dependency_job_id":null,"html_url":"https://github.com/jrfiedler/causal_inference_python_code","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrfiedler%2Fcausal_inference_python_code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrfiedler%2Fcausal_inference_python_code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrfiedler%2Fcausal_inference_python_code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrfiedler%2Fcausal_inference_python_code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jrfiedler","download_url":"https://codeload.github.com/jrfiedler/causal_inference_python_code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478191,"owners_count":22077676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["causal-inference","causality","data-science","python"],"created_at":"2024-07-31T00:01:51.995Z","updated_at":"2025-05-16T06:07:27.771Z","avatar_url":"https://github.com/jrfiedler.png","language":"Jupyter Notebook","readme":"# Python Code for _Causal Inference: What If_\n\nThis repo contains Python code for Part II of the book _Causal Inference: What If_, by Miguel Hernán and James Robins ([book site](https://www.hsph.harvard.edu/miguel-hernan/causal-inference-book/)):\n\n\u003e Hernán MA, Robins JM (2020). _Causal Inference: What If_. Boca Raton: Chapman \u0026 Hall/CRC.\n\nThis Python version roughly corresponds to the Stata, R, or SAS programs found at the book site, and was also translated into Julia, [here](http://www.github.com/jrfiedler/causal_inference_julia_code).\n\nThe code in this repo has been checked against the 30 March 2021 version of the book.\n\n\n## Python dependencies\n\nRequired Python packages:\n\n- numpy\n- pandas\n- statsmodels\n- scipy\n- matplotlib\n- linearmodels\n- tqdm\n\nIf you use the [Anaconda](https://www.anaconda.com/distribution/) distribution of Python, you'll have most of those packages already, and you'll only need to install\n\n- linearmodels\n- tqdm\n\n\n## Data\n\nThe data can be obtained from the [book site](https://www.hsph.harvard.edu/miguel-hernan/causal-inference-book/).\n\nThe notebooks all assume that the Excel version of the data has been saved in the same directory as the notebooks.\n\n\n## Author\n\nJames Fiedler, with contributions from [Petty PY Chen](https://github.com/pettypychen) and [Piyush Madan](https://github.com/piyushmadan)\n","funding_links":[],"categories":["Jupyter Notebook"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrfiedler%2Fcausal_inference_python_code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjrfiedler%2Fcausal_inference_python_code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrfiedler%2Fcausal_inference_python_code/lists"}