3 — Methodology
Manuscript · APA section
Manuscript · Section 3 of 7 · Paper landing
3.1 Research design
Longitudinal ecological panel design; unit of analysis is the district-month (77 districts × 108 months, January 2015 – December 2023; N = 7,327 valid observations after dropping initial lag rows) (Bao et al., 2023; Hashizume et al., 2010).
3.2 Study area
The 77 administrative districts of Nepal span three ecological zones: Terai (~17 % land area, > 50 % population), Middle Hills (~68 % land area), and High Mountain (~15 % land area). Precipitation is concentrated in the June–September monsoon (~75–80 % of annual total). Public health system is organized in three tiers (district hospitals, primary health care centers, village-level health posts), all reporting through HMIS. WASH coverage varies from 78 % (Bagmati) to 43 % (Karnali) at the provincial level (Central Bureau of Statistics and UNICEF, 2019).
3.3 Data sources
Four primary institutional and open-access sources documented in detail in §6 Data:
| Dataset | Variable | Resolution | Provider | Reference |
|---|---|---|---|---|
| HMIS | Monthly outpatient typhoid case counts | District-month | MoHP / DoHS, Nepal | (Ministry of Health and Population, Government of Nepal, 2023) |
| DRR Portal | Flood event counts | District-month | NDRRMA, Nepal | (NPDRR Nepal, 2025) |
| CHIRPS v2.0 | Precipitation | 0.05° (~5 km) | Climate Hazards Group | (Funk et al., 2015) |
| ERA5-Land | 2 m air temperature, relative humidity | 0.1° (~9 km) | ECMWF · Copernicus | (Muñoz-Sabater et al., 2021) |
3.4 Data cleaning and integration
- Calendar conversion — Bikram Sambat → Gregorian via 12-month mapping table (max alignment error ~15 days).
- District-code reconciliation — CBS 3-digit codes used as primary spatial merge key; 12 name-spelling variants resolved against CBS lookup.
- Numeric cleaning — Comma-formatted HMIS counts parsed; 847 records corrected. Extreme values audited against district annual reports.
- Spatial aggregation — CHIRPS and ERA5-Land grids aggregated to district polygons by area-weighted zonal statistics.
- Missing data — 2,463 district-months with missing HMIS data excluded; no outcome imputation. Final analytical sample: N = 7,327.
3.5 Feature engineering
Eleven features were engineered from the raw dataset:
| Feature | Category | Derivation |
|---|---|---|
log_cases |
Outcome transform | log(cases + 1) |
cases_lag1 |
Autoregressive | cases value from prior calendar month, same district |
precip_lag1 |
Lagged climate | CHIRPS precipitation shifted 1 month |
temp_mean_lag1 |
Lagged climate | ERA5-Land temperature shifted 1 month |
humidity_lag1 |
Lagged climate | ERA5-Land humidity shifted 1 month |
flood_lag1 |
Lagged climate | DRR flood count shifted 1 month |
precip_roll3 |
Cumulative climate | Rolling mean over t, t−1, t−2 |
temp_roll3 |
Cumulative climate | Rolling mean over t, t−1, t−2 |
monsoon |
Seasonal indicator | 1 if month ∈ {Jun, Jul, Aug, Sep} |
month_sin |
Cyclical encoding | sin(2π × month / 12) |
month_cos |
Cyclical encoding | cos(2π × month / 12) |
All lag and rolling features were computed within each district to prevent cross-district leakage.
3.6 Train-test split
Strictly chronological — the last 12 calendar months (January 2022 – December 2023) are reserved as the held-out test set. Within training, a TimeSeriesSplit (k = 5) is used for XGBoost hyperparameter selection.
3.7 Machine-learning models
3.7.1 Random Forest
scikit-learn 1.3 (Pedregosa et al., 2011); n_estimators=300, max_depth=10, min_samples_leaf=5, seed = 42.
3.7.2 XGBoost
xgboost 1.7 (Chen & Guestrin, 2016); n_estimators=300, learning_rate=0.05, max_depth=4, subsample=0.80, colsample_bytree=0.80, reg_alpha=0.10, reg_lambda=1.00, seed = 42; early stopping on 10 % validation fold.
3.7.3 Multilayer Perceptron
scikit-learn MLPRegressor (Pedregosa et al., 2011); hidden layers (128, 64, 32), ReLU, Adam optimizer @ 1e-3 learning rate, early stopping on 10 % validation fold, seed = 42. Input features standardized using StandardScaler parameters estimated exclusively from the training set.
3.8 Model evaluation metrics
- RMSE = \(\sqrt{\sum (y_i - \hat{y}_i)^2 / n}\) — cases per district per month.
- MAE = \(\sum |y_i - \hat{y}_i| / n\) — scale-interpretable.
- R² = \(1 - SS_{\text{res}} / SS_{\text{tot}}\) — variance explained.
- MAPE = \(100\% \times \sum |y_i - \hat{y}_i| / y_i / n\) — percentage error.
All metrics computed on back-transformed (exponentiated) case-count predictions for RMSE and MAE; R² computed on log-scale predictions.
3.9 Ethical considerations and limitations
The study used only aggregate, de-identified, district-level surveillance and climate data; no individual patient records were accessed. Five categories of limitation are acknowledged: HMIS under-reporting, diagnostic misclassification, spatial aggregation of climate data, flood-event underregistration, and the ecological fallacy. See §6 Data for full discussion.
← Back: 2 — Literature Review · → Next: 4 — Results