Press "Enter" to skip to content

Day: November 6, 2026

A Simple Simulation of Simpson’s Paradox

Zhenguo Zhang demonstrates a principle:

Simpson’s paradox occurs when the direction of an association reverses after data from several groups are combined. For example, A can have a higher success rate than B in every subgroup, yet a lower success rate overall.

In this post, we will simulate exam outcomes in Python, examine the reversal using logistic regression and a plotnine figure, and explain why it happens. All Python code is embedded in this R Markdown document and runs through reticulate.

Click through for the code and demonstration.

Leave a Comment

From SAS to R

Gigi Kenneth continues a series:

If you’re moving regulated analysis from SAS to R, two things are worth knowing up front. R is a choice you can defend: regulators don’t tell you which software to use, and R has already been through FDA review in public pilot submissions. And the language itself is the cheap part. Most of the cost and risk comes from six other places, and most of those are about planning, not programming.

Part one asked whether SAS is still worth keeping. This post covers why R, and where to put your budget and attention once you commit.

Click through for several notes that may trip up a migration, particularly in a clinical environment.

Leave a Comment