{"id":28629529,"url":"https://github.com/carloscinelli/dml.sensemakr","last_synced_at":"2025-12-24T02:03:47.633Z","repository":{"id":88626484,"uuid":"533125109","full_name":"carloscinelli/dml.sensemakr","owner":"carloscinelli","description":"Sensitivity analysis tools for causal ML","archived":false,"fork":false,"pushed_at":"2025-07-25T07:55:50.000Z","size":152075,"stargazers_count":17,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-25T13:30:36.037Z","etag":null,"topics":["causal-inference","debiased-machine-learning","double-machine-learning","machine-learning","r","r-package","sensitivity-analysis"],"latest_commit_sha":null,"homepage":"http://carloscinelli.com/dml.sensemakr/","language":"R","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/carloscinelli.png","metadata":{"files":{"readme":"README.Rmd","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-06T02:02:45.000Z","updated_at":"2025-07-25T07:55:54.000Z","dependencies_parsed_at":"2025-07-25T09:39:33.593Z","dependency_job_id":null,"html_url":"https://github.com/carloscinelli/dml.sensemakr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/carloscinelli/dml.sensemakr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloscinelli%2Fdml.sensemakr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloscinelli%2Fdml.sensemakr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloscinelli%2Fdml.sensemakr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloscinelli%2Fdml.sensemakr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carloscinelli","download_url":"https://codeload.github.com/carloscinelli/dml.sensemakr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloscinelli%2Fdml.sensemakr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27992996,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","debiased-machine-learning","double-machine-learning","machine-learning","r","r-package","sensitivity-analysis"],"created_at":"2025-06-12T12:01:37.802Z","updated_at":"2025-12-24T02:03:47.626Z","avatar_url":"https://github.com/carloscinelli.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  cache = F,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# dml.sensemakr\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\n`dml.sensemakr` implements a general suite of sensitivity analysis tools for Causal Machine Learning as discussed in [Chernozhukov, V., Cinelli, C., Newey, W., Sharma A., and Syrgkanis, V. (2021). \"Long Story Short: Omitted Variable Bias in Causal Machine Learning.\"](https://www.nber.org/papers/w30302)\n\n\n# Development version\n\nTo install the development version on GitHub make sure you have the package devtools installed.\n\n```{r, eval = FALSE}\n# install.packages(\"devtools\") \ndevtools::install_github(\"carloscinelli/dml.sensemakr\")\n```\n\n# CRAN\n\nCRAN version coming soon.\n\n\n# Details\n\nFor theoretical details [please see the working paper.](https://www.nber.org/papers/w30302) \n\nFor a primer on Debiased Machine Learning, \n[please check Chernozukohv et al (2018).](https://academic.oup.com/ectj/article/21/1/C1/5056401) \n\nSome presentations that may be useful:\n\n- [Carlos' presentation at the ICLR.](http://interactivecausallearning.com/Carlos_Cinelli.html)\n- [Victor's tutorial at the Chamberlain Seminar.](https://www.youtube.com/watch?v=PQtYqKfxH_I)\n\n# Basic Usage\n\n```{r basic-usage, fig.align='center', collapse=T, dpi=300}\n# loads package\nlibrary(dml.sensemakr)\n\n## loads data\ndata(\"pension\")\n\n# set treatment, outcome and covariates\ny \u003c- pension$net_tfa  # net total financial assets\nd \u003c- pension$e401     # 401K eligibility\nx \u003c- model.matrix(~ -1 + age + inc  + educ+ fsize + marr + twoearn + pira + hown, data = pension)\n\n# run DML (nonparametric model)\ndml.401k \u003c- dml(y, d, x, model = \"npm\")\n\n# summary of results with median method (default)\nsummary(dml.401k)\n\n# sensitivity analysis\nsens.401k \u003c- sensemakr(dml.401k, cf.y = 0.04, cf.d = 0.03)\n\n# summary\nsummary(sens.401k)\n\n# contout plots\nplot(sens.401k)\n```\n\n\u003c!-- ### Use DML to estimate the ATE --\u003e\n\n\u003c!-- ```{r} --\u003e\n\n\u003c!-- ``` --\u003e\n\n\u003c!-- ### Explore results --\u003e\n\u003c!-- ```{r} --\u003e\n\n\u003c!-- ``` --\u003e\n\n\u003c!-- ### Extract coefs, se, confidence intervals --\u003e\n\u003c!-- ```{r} --\u003e\n\u003c!-- # coef median method (default) --\u003e\n\u003c!-- coef(dml.401k, combine.method = \"median\") --\u003e\n\n\u003c!-- # se median method (default) --\u003e\n\u003c!-- se(dml.401k, combine.method = \"median\") --\u003e\n\n\u003c!-- # confint median method --\u003e\n\u003c!-- confint(dml.401k, combine.method = \"median\") --\u003e\n\u003c!-- ``` --\u003e\n\n\u003c!-- ### Coefficients Plot --\u003e\n\n\u003c!-- ```{r} --\u003e\n\u003c!-- plot(dml.401k) --\u003e\n\u003c!-- ``` --\u003e\n\n\u003c!-- ### You can add groups after the model is fit --\u003e\n\n\u003c!-- ```{r} --\u003e\n\u003c!-- ## compute GATE by married --\u003e\n\u003c!-- g2 \u003c- ifelse(pension$marr, \"married\", \"not.married\") --\u003e\n\u003c!-- dml.401k.g2 \u003c- dml_gate(dml.fit = dml.401k, groups = g2) --\u003e\n\u003c!-- summary(dml.401k.g2) --\u003e\n\n\u003c!-- coef(dml.401k.g2) --\u003e\n\u003c!-- confint(dml.401k.g2) --\u003e\n\u003c!-- plot(dml.401k.g2) --\u003e\n\u003c!-- ``` --\u003e\n\n\u003c!-- ## Sensitivity Analysis --\u003e\n\n\u003c!-- ### Robustness Values --\u003e\n\n\u003c!-- ```{r} --\u003e\n\n\u003c!-- ``` --\u003e\n\n\u003c!-- ### Confidence Bounds --\u003e\n\n\u003c!-- ```{r} --\u003e\n\n\u003c!-- ``` --\u003e\n\n\u003c!-- ### Contour Plots --\u003e\n\n\u003c!-- ```{r, fig.width=12} --\u003e\n\n\u003c!-- ``` --\u003e\n\n\n\u003c!-- ### Further results --\u003e\n\n\u003c!-- ```{r} --\u003e\n\u003c!-- bounds.401k \u003c- dml_bounds(dml.401k, cf.y = 0.03, cf.d = 0.04) --\u003e\n\u003c!-- bounds.401k --\u003e\n\u003c!-- ``` --\u003e\n\n\u003c!-- ```{r} --\u003e\n\u003c!-- coef(bounds.401k) --\u003e\n\u003c!-- se(bounds.401k) --\u003e\n\u003c!-- confint(bounds.401k) --\u003e\n\u003c!-- ``` --\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarloscinelli%2Fdml.sensemakr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarloscinelli%2Fdml.sensemakr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarloscinelli%2Fdml.sensemakr/lists"}