Skip to content

sidhikabalachandar/domain_constraints

Repository files navigation

domain_constraints

Code to generate synthetic data experiments and associated results in "Domain constraints improve healthcare risk prediction when outcome data is missing".

Regenerating results

  1. Conda environment. The conda environment we use is specified in domain_constraints.yml.
  2. Generating synthetic data. We provide code to generate data using three different data generating processes: 1) Heckman model (generate_synthetic_data_heckman.py), 2) Bernoulli-sigmoid model with uniform unobservables (generate_synthetic_data_bin_Y.py), and 3) Bernoulli-sigmoid model with normal unobservables (generate_synthetic_data_bin_Y.py). In all cases we provide cdoe to generate multiple synthetic datasets for which parameters are drawn from a normal distribution with user specified means and standard deviations.
  3. Fitting model. We provide code to fit three different models in stan: 1) Heckman model (fit_model_heckman.py), 2) Bernoulli-sigmoid model with uniform unobservables (fit_model_bin_Y.py), and 3) Bernoulli-sigmoid model with normal unobservables (fit_model_bin_Y.py). The Heckman model estimates parameters $(\beta_Y, \beta_T, \rho, \sigma^2)$, the Bernoulli-sigmoid model with uniform unobservables estimates parameters $(\beta_Y, \beta_\Delta, \sigma^2)$ and uses a fixed $\alpha=1$, the Bernoulli-sigmoid model with normal unobservables can either estimate parameters $(\beta_Y, \beta_\Delta, \sigma^2)$ with a fixed $\alpha$ or estimate parameters $(\beta_Y, \beta_\Delta, \alpha)$ with a fixed $\sigma^2$.
  4. Analyzing model fit. Once models have been fit, figures and results in the paper can be reproduced by running make_figures.ipynb. We provide code to reproduce Figure 2 in the main text of the paper, however this code can be slightly modified to create the other figures in Appendix C. This code relies on a compiled results file called results.csv containing paths to the data and stan samples. More details are included in make_figures.ipynb.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published