This is the code of our paper "Adaptive Data-Borrowing for Improving Causal Effect Estimation using External Controls".

Folder Structure:

1· "/example/" - includes the example code in Section 7.
    generate_data.py - includes the data generation process.
    influence_selection.py - includes the influence selection process.
    lasso_selection.py - includes the LASSO selection process.
    main_example.py - includes the main function.

    To recover our experiment results, please run "main_example.py" file.

2· "/application/" - Contains primary research code in Section 8.
    simulate_data.py - includes the data generation process.
    estimator.py - includes the estimator.
    main.py - includes the main function.
    We put our final data in the "dataset" folder, named "NSW" and "simulated_data".
    We put our experimental results in the "results" folder.

    To recover our experiment results, please run "main.py" and "main.py" file.
