0:00 / 0:00
Volume: 50%

Air Pollution & Respiratory Disease Modeling

7
Course
Machine Learning
Public Health
Data Science
0:00 / 0:00
Volume: 50%

Air Pollution & Respiratory Disease Modeling

Air Pollution & Respiratory Disease Modeling

7
Course
Machine Learning
Public Health
Data Science
Data Science
Stack

Python · scikit-learn · pandas

Predicting Respiratory Disease Prevalence From Environmental Data
Predicting Respiratory Disease Prevalence From Environmental Data

I modeled whether county-level air pollution measurements could distinguish U.S. counties with higher asthma or COPD prevalence. The main challenge was not model training, but joining health, air-toxics, and AQI datasets built around incompatible geographic identifiers.

The Hard Part

This was a STAT 109 course project with Jan Tobias Boehnke and Megha Sharma at Harvard. The health and air-toxics datasets used county FIPS codes, while EPA AQI observations were indexed by CBSA, a metro-area identifier that cannot be joined directly to counties.


I resolved the mismatch with an NBER CBSA-to-FIPS crosswalk. I reconstructed five-digit county identifiers, zero-padded both key types so leading zeros were not silently lost, linked CBSA observations to counties, and aggregated repeated AQI measurements before modeling. That geographic reconciliation was the most consequential data-engineering step in the project.

Results
76% asthma accuracy · 0.80 recall on high-prevalence counties

76% asthma accuracy · 0.80 recall on high-prevalence counties

78% COPD accuracy · 0.81 recall on high-prevalence counties

78% COPD accuracy · 0.81 recall on high-prevalence counties

Acetaldehyde and formaldehyde ranked among the strongest predictors for both conditions

Acetaldehyde and formaldehyde ranked among the strongest predictors for both conditions

Methodology

&

Insights

Approach & Results

I defined high prevalence as being above the dataset median and compared Random Forest, logistic regression, and linear regression. For the Random Forest models, I used 200 trees, balanced class weights, and a stratified 70/30 train-test split.

Random Forest reached 76% accuracy on 922 asthma test observations and 78% on 922 COPD observations. For a public-health screening interpretation, recall is more informative than accuracy alone: the models recovered 80% of high-prevalence asthma observations and 81% of high-prevalence COPD observations.

Acetaldehyde, formaldehyde, benzene, and diesel particulate matter repeatedly ranked near the top of the feature-importance results. I treated those relationships as associations, not evidence that any pollutant caused disease.

What Didn’t Work

My first linear-regression analysis produced strongly negative R² values. I initially interpreted that as evidence that the underlying relationships were nonlinear, but the implementation had an important flaw: I passed OLS predictions through a sigmoid after already scaling the target to [0,1]. That compressed predictions toward the middle of the range, so the reported R² could not cleanly answer whether linear regression itself was inadequate.

I also found an interpretability warning in the logistic models. Diesel particulate matter ranked highly in the Random Forest model but had a large negative COPD logistic coefficient. Without further multicollinearity diagnostics or SHAP analysis, I would not interpret that sign as evidence of a protective association. Reporting a coefficient I could not explain would have been less useful than identifying what additional analysis it required.

What the Model Can’t Tell us

This was a county-level observational analysis, so its associations do not transfer directly to individuals. A county with higher formaldehyde concentrations and higher asthma prevalence does not establish that the residents with asthma were the residents receiving the highest exposure.

Important confounders were also absent, including smoking prevalence, population density, income, occupation, and healthcare access. The datasets were temporally mismatched as well: air-toxics measurements were from 2019, health outcomes from 2021, and AQI measurements from 2024.

Finally, converting continuous disease prevalence into a high/low target discarded information. I would next construct the target at one row per county, add socioeconomic and urban-density covariates on the same FIPS key, and evaluate continuous prevalence with MAE and out-of-sample R².