Tutorials and notebooks Overview
The tutorials here present various examples of applying balance end-to-end. Each tutorial is linked to a Jupyter notebook you can download and run from your own environment.
Requirements: You will need a Jupyter installation to run these notebooks yourselves. We also assume you have the balance pkg installed.
If you are new to balance, we suggest getting started with the balance Quickstart tutorial.
Tutorials list (more tutorials to be added soon):
- quickstart - this is based on a simulated data and presents the simple end-to-end workflow of balance package with default arguments. It demonstrates the process from reading the data, through understanding the biases in the sample, producing weights, evaluating the results and producing the population estimations.
- quickstart_cbps - like the quickstart tutorial, but shows how to use the CBPS algorithm and compares the results to IPW (logistic regression with LASSO).
- quickstart_rake - like the quickstart tutorial, but shows how to use the rake (raking) algorithm and compares the results to IPW (logistic regression with LASSO).
- balance_transformations_and_formulas - This tutorial showcases ways in which transformations, formulas and penalty can be included in your pre-processing of the covariates before adjusting for them.
- comparing_cbps_in_r_vs_python_using_sim_data - This notebook compares the results of running CBPS in R and Python. In R using the
BCPS
package, and in Python using thebalance
package. The results are almost identical.