Causal Curve 1.0.0! 🎉


Back in the summer of 2020 (AKA the first COVID summer), if you were lucky enough to have a job where you could work remotely, you probably sat around your home all week long, alternating between checking in on family, doing work, longingly looking out windows, and baking bread for the first time in your life1.


What started as a project for me to pass the time during that first 2020 COVID summer has grown into a proper python package! I just released a major, 3500-line overhaul of the the causal-curve package.

You can read the documentation on Read The Docs or in the published paper associated with the package, but in a nutshell this package provides a set of tools for carrying out causal inference analysis (specifically when the treatment of interest is a continuous variable). That's a really technical explanation, so I'll also say that it's helpful in any of the following situations if you'd like to understand how:

  • the number of minutes per week of people aerobic exercise causes positive health outcomes, after controlling for confounding effects.
  • increasing or decreasing the price of a product would impact demand (price elasticity).
  • changing neighborhood income inequality (as measured by the continuous Gini index) might or might not be causally related to the neighborhood crime rate.2
  • blood lead levels are causally related to neurodevelopment delays in children.
Each of the treatments/exposures/variables of interest are on a continuous, sliding scale and they aren't simple binaries. What this package does is visualize that causal relationship on a curve. There are multiple ways this differs from a simple plot of two variables and calculating a curve of best. I won't go on and on describing it because the documentation is elsewhere.

Example of causal curve

Even more exciting is seeing that it's really being used out the real world! I've had multiple folks reach out asking questions about their particular use cases. Thus far the majority have been research-oriented such as someone doing work in the intensive care medicine research space. Some people have been kind enough to give me good details on bugs they encountered, and I thank them for that!

causal curve usage