Path: blob/master/notebooks/book2/15/linreg_hierarchical_non_centered_blackjax.ipynb
1192 views
Hierarchical linear regression for the radon dataset
Based on https://twiecki.io/blog/2014/03/17/bayesian-glms-3/ and https://twiecki.io/blog/2017/02/08/bayesian-hierchical-non-centered/
This code uses blackjax for MCMC inference. See also these alternative (deprecated) implementations.
Gelman et al.'s (2007) radon dataset is a classic for hierarchical modeling. In this dataset the amount of the radioactive gas radon has been measured among different households in all county's of several states. Radon gas is known to be the highest cause of lung cancer in non-smokers. It is believed to enter the house through the basement. Moreover, its concentration is thought to differ regionally due to different types of soil.
Here we'll investigate this difference and try to make predictions of radon levels in different countys and where in the house radon was measured. In this example we'll look at Minnesota, a state that contains 85 county's in which different measurements are taken, ranging from 2 till 80 measurements per county.