https://github.com/forestry-labs/metalearners-reproduction
https://github.com/forestry-labs/metalearners-reproduction
paper
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/forestry-labs/metalearners-reproduction
- Owner: forestry-labs
- Created: 2021-04-22T20:04:09.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-22T20:04:20.000Z (about 4 years ago)
- Last Synced: 2025-01-06T02:21:08.030Z (4 months ago)
- Topics: paper
- Language: R
- Size: 58.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Replication Repository
This repository contains the code needed to replicate the simulations in the paper:
[Metalearners for estimating heterogeneous treatment effects using machine learning](https://www.pnas.org/content/116/10/4156).
The code folder contains several folders for replicating the simulations in
different sections of the paper.## Installation
The package `causalToolbox` is required to run the replication code.
This can be installed using:```
if (!require("devtools")){
install.packages("devtools")
}
devtools::install_github("forestry-labs/causalToolbox")
```It is also required to install the packages
[Rforestry](https://CRAN.R-project.org/package=Rforestry) and
[dbarts](https://CRAN.R-project.org/package=dbarts).## Running Simulations
In order to run the simulations, you can run the corresponding script, and optionally
supply the maximum sample size to run, and the numbers of replications to run.
For example, to run Experiment 1: (unbalanced treatment assignment) with a
maximum sample size of 20,000, and 10 Monte Carlo replications, you should run:```
Rscript 1-Sim_SI.R --n 20000 --r 10
```In order to plot the results, run:
```
Rscript 7-plot_results.R
```
This will plot the results for all the experiments run, and update the plots in the
`figures` folder.