Environmental and household factors associated with depressive symptoms in rural Kilifi County, Kenya: a machine learning analysis.
John Andrew, Ashley Njoroge, David Andai, Edna Bosire, Jasmit Shah
Brain and Mind Institute, Aga Khan University, Nairobi, Kenya.
Key points
From the paper's conclusion- This study applies machine learning models to examine how climate perceptions, water and sanitation access, and household air pollution proxies are associated with depressive symptoms in Kilifi County.
Abstract
BACKGROUND: Depression is a leading global cause of disability, that disproportionately affects populations in low-resource settings in sub-Saharan Africa, where poverty, limited healthcare, and environmental stressors such as climate variability, poor water and sanitation, and household air pollution compound vulnerability. In Kilifi County, Kenya, recurrent droughts and economic insecurity amplify these challenges, yet the associations between environmental exposures and mental health impacts remain poorly characterized. This study applies machine learning models to examine how climate perceptions, water and sanitation access, and household air pollution proxies are associated with depressive symptoms in Kilifi County. METHODOLOGY: This cross-sectional study analyzed primary household survey data collected from July to December 2021 within the Kaloleni/Rabai Community Health and Demographic Surveillance System. Structured surveys captured demographics, mental health status via the Patient Health Questionnaire-9 (PHQ-9), and environmental exposures, including climate perceptions, agricultural stressors, water and sanitation access, and air pollution proxies. Depression was defined as PHQ-9 ≥ 10. Thirty-one variables were grouped into environmental perceptions, climate impacts, air pollution proxies, and water/sanitation categories. Random Forest and XGBoost models were trained in Python using 80/20 household-grouped train-test split (GroupShuffleSplit) to prevent data leakage, with 10-fold stratified group cross-validation. Class imbalance was addressed using balanced class weights (Random Forest) and scale_pos_weight (XGBoost). Model performance was assessed using accuracy, balanced accuracy, ROC-AUC, PR-AUC, sensitivity, specificity, precision, recall, F1-scores, and Brier scores with bootstrap 95% confidence intervals. Feature contributions were evaluated using Gini importance, gain and SHAP values. RESULTS: Among 17,738 participants (median age 41.0 [IQR 31.0-54.0], 77.8% female), 14.9% (n = 2,635) screened positive for depression (PHQ-9 ≥ 10). XGBoost outperformed Random Forest across all metrics: 0.802 (95% CI: 0.788-0.815) versus 0.796 (95% CI: 0.782-0.808), ROC-AUC 0.845 (95% CI, 0.826-0.862) versus 0.823 (95% CI, 0.804-0.841), balanced accuracy 0.753 versus 0.738, and sensitivity 0.684 versus 0.657. Both models showed moderate precision for depression-positive cases (XGBoost 0.40, Random Forest 0.38) reflecting the precision-sensitivity trade-off inherent in class-imbalance handling. Key predictors across Gini importance, gain and SHAP analyses included drinking water source, heat-related health risks, drought exposure, home thermal discomfort and cooking with open fire highlighting the convergence of water/sanitation, climate, and household air quality factors. CONCLUSION: Environmental and household exposures are consistently associated with depression in rural Kilifi County. Machine learning identified water and sanitation conditions, climate variability perceptions, and household energy practices as leading predictors. Integrating environmental and climate-sensitive indicators into community health workflows, alongside interventions such as clean cookstoves, water access and climate-resilient agriculture, could reduce depression burden and enhance precision public health for climate-vulnerable communities. Longitudinal studies with refined exposure measurement are needed to clarify the temporal and causal nature of these associations.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Extreme drought and risk of depressive symptoms among middle-aged and older chinese adults.BMC psychology · 2026
- Associations between extreme weather events and resource insecurities with depression and anxiety symptoms among older adults in Moshi, Tanzania: Cross-sectional analysesCambridge Prisms: Global Mental Health · 2026
- When income buffers extreme weather: Impacts on women’s mental health in informal settlementsPLOS Climate · 2026
- Climate stress, migration, and emotional dimensions of malaria vulnerability: a mixed-methods study in an urban informal settlement, South Africa.BMC public health · 2026
- Examining the association between household water insecurity, food insecurity and depression among people living with HIV in GhanaPLOS Water · 2026
- Psychosocial Factors Associated With Depressive Symptoms Among Adults Living in Rural Amazonian Communities in Peru.Journal of primary care & community health · 2026