Python module designed to analyze randomized block design. Blocks can be population segments derived from a predictive model, an uplift score, or any business rule. Individuals within each block have to be randomized in a treated and control group. The sample size ratio between treated and control can differ between blocks. When combining blocks, the Weighted Average Treatment Effect is calculated to mitigate the confounding effect of blocks and avoid Simpson's paradox.
With blockeval, users can:
- Estimate the treatment effect for each block
- Roll-up results to get effects for groups of blocks or the entire campaign
- Compare the treatment effects between blocks or groups of blocks (uplift)
- Resolve Simpson’s paradox
- Provide p-values and confidence intervals
- Handle non-normal distributions with bootstrapping
Results are also valid if the blocks are defined after the intervention in a completely randomized design (as opposed to a randomized block design).
- Mathieu d'Acremont
- Audrey Lee
The latest version from PyPI can be installed using the following command:
pip install blockeval
To check the installation, open a Jupyter Notebook and try importing the package functions:
from blockeval.analysis import *
from blockeval.utils import campaign_simulation
Please follow this notebook for a quick introduction to the package.
We wrote a comprehensive review of blockeval in a Medium blog post with a companion notebook.