# Methodology: Probabilistic Modeling for Nigerian Health Dataset ## Overview This document details the probabilistic modeling methodology used to transform a generic smoking health dataset into a Nigerian-contextualized version with realistic epidemiological relationships. --- ## Core Principles ### 1. **Evidence-Based Probabilities** - All probability distributions derived from peer-reviewed research - Multiple sources used to validate each parameter - Preference for Nigerian-specific studies over global estimates ### 2. **Conditional Relationships** - Health outcomes depend on multiple interacting factors - Probabilistic cascades model real-world dependencies - Avoid independence assumptions where evidence shows correlation ### 3. **Population-Level Accuracy** - Individual records may vary - Aggregate statistics match research targets - Distributions reflect Nigerian demographic reality --- ## Probabilistic Generation Pipeline ### Stage 1: Demographics ``` Step 1.1: Assign Sex ├─ P(Male) = 0.504 └─ P(Female) = 0.496 Step 1.2: Assign Age ├─ Age distribution: Nigeria's young population structure ├─ P(18-25) = 0.25 ├─ P(26-35) = 0.30 ← Peak working age ├─ P(36-45) = 0.20 ├─ P(46-55) = 0.15 └─ P(56-70) = 0.10 Step 1.3: Assign Region ├─ South-West: 25% (Lagos, Ibadan, etc.) ├─ North-West: 20% (Kano, Kaduna, etc.) ├─ South-South: 18% (Port Harcourt, etc.) ├─ South-East: 15% (Enugu, Onitsha, etc.) ├─ North-Central: 12% (Abuja, Jos, etc.) └─ North-East: 10% (Maiduguri, etc.) Step 1.4: Assign Location Type (Urban vs Rural) ├─ P(Urban | Region) = region-specific urbanization rate └─ Example: P(Urban | South-West) = 0.60 ``` **Justification:** - Sex ratio from National Bureau of Statistics - Age distribution reflects Nigeria's median age of 18.6 years - Regional populations weighted by census data - Urban/rural splits vary by region's development --- ### Stage 2: Behavioral Risk Factors ``` Step 2.1: Determine Smoking Status P(Smoker | Sex, Age, Region, Location) = BaseRate(Sex, AgeGroup) × RegionalModifier(Region, Location) Where: BaseRate(Male, 18-34) = 0.06 BaseRate(Male, 35-54) = 0.11 ← Peak prevalence BaseRate(Male, 55+) = 0.08 BaseRate(Female, 18-34) = 0.008 BaseRate(Female, 35-54) = 0.015 BaseRate(Female, 55+) = 0.005 RegionalModifier accounts for: - Urban vs rural differences - Cultural factors (e.g., lower in Islamic North) - Economic factors (affordability) Step 2.2: Assign Cigarettes Per Day (if Smoker) Distribution for smokers: ├─ Light (1-10 cigs): 65% ← Economic constraints ├─ Moderate (11-20 cigs): 30% └─ Heavy (21-40 cigs): 5% Mean: ~11 cigarettes/day (vs 18.6 in Western datasets) ``` **Justification:** - Multi-factor smoking probability reflects real-world complexity - Gender disparity (9:1 male:female) matches cultural norms - Lower consumption than Western countries (economic factors) - Age peak at 35-54 years (stress, affordability) --- ### Stage 3: Genetic Factors ``` Step 3.1: Assign Sickle Cell Genotype P(AA) = 0.76 ← Normal hemoglobin P(AS) = 0.22 ← Sickle cell trait (carrier) P(SS) = 0.02 ← Sickle cell disease This is INDEPENDENT of other factors (genetic inheritance) ``` **Justification:** - Hardy-Weinberg equilibrium - Nigeria has world's largest SCD population - 24% carrier rate (AS) is well-documented - SS prevalence 2-3% from newborn screening data --- ### Stage 4: Environmental Exposures ``` Step 4.1: Assign Malaria Exposure P(Malaria | Region, Location) depends on: - Regional endemicity - Urban vs rural (urban has lower transmission) - Season (not modeled, but implicit in "chronic") Categories: ├─ Recent episode (<3 months) ├─ Chronic/repeated (multiple times per year) └─ Rare/never Example for South-South (very high endemicity): P(Recent | South-South, Rural) = 0.30 P(Chronic | South-South, Rural) = 0.50 P(Rare | South-South, Rural) = 0.20 ``` **Justification:** - Nigeria Malaria Indicator Survey 2021 data - Regional parasite prevalence: 10-70% - Urban sanitation reduces transmission - ~60 million clinical cases annually supports high prevalence --- ### Stage 5: Health Outcomes (Conditional Probabilities) This is where the model becomes sophisticated - health metrics depend on ALL previous factors. #### 5.1 Hemoglobin Level ```python Hemoglobin = BaselineHb(Sex) × SickleCellEffect(Genotype) - MalariaEffect(MalariaStatus) - AgeEffect(Age) + RandomVariation Where: BaselineHb(Male) ~ Normal(14.5, 1.2) g/dL BaselineHb(Female) ~ Normal(13.0, 1.0) g/dL SickleCellEffect: If SS: ×0.55 (severe chronic anemia, 6-8 g/dL) If AS: ×0.95 (mild reduction) If AA: ×1.00 (normal) MalariaEffect: Recent: -1.5 to -3.0 g/dL (acute hemolysis) Chronic: -0.5 to -1.5 g/dL (ongoing destruction) Rare: 0 g/dL AgeEffect: Age >60: -0.3 to -0.8 g/dL (physiological decline) Final range clamped: 6.0 - 18.0 g/dL (realistic bounds) ``` **Clinical Justification:** - Sickle cell disease causes severe baseline anemia - Malaria destroys red blood cells (hemolysis) - Combined effects are MULTIPLICATIVE (SS + malaria = very low Hb) - Age-related decline is well-documented **Example Cases:** ``` Case 1: Young male, AA genotype, no malaria Hb = 14.5 × 1.0 - 0 - 0 + ε = ~14.5 g/dL ✓ Normal Case 2: Young male, SS genotype, no malaria Hb = 14.5 × 0.55 - 0 - 0 + ε = ~8.0 g/dL ✓ SCD anemia Case 3: Young female, AA genotype, recent malaria Hb = 13.0 × 1.0 - 2.5 - 0 + ε = ~10.5 g/dL ✓ Acute anemia Case 4: Young female, SS genotype, recent malaria Hb = 13.0 × 0.55 - 2.5 - 0 + ε = ~4.6 g/dL → 6.0 g/dL (Clamped to minimum; would require hospitalization) ``` --- #### 5.2 Heart Rate ```python HeartRate = BaselineHR + AnemiaCompensation(Hemoglobin) + SickleCell Effect(Genotype) + SmokingEffect(IsSmoker) + MalariaEffect(MalariaStatus) + RandomVariation Where: BaselineHR ~ Normal(72, 10) bpm AnemiaCompensation: If Hb < 10: +15 to +25 bpm ← Severe compensation If Hb 10-12: +5 to +15 bpm ← Moderate compensation If Hb > 12: 0 bpm ← Normal SickleCellEffect: If SS: +10 to +20 bpm (chronic hypoxia) SmokingEffect: If Smoker: +5 to +15 bpm (stimulant effect) MalariaEffect: Recent: +10 to +20 bpm (acute illness, fever) Final range clamped: 50 - 140 bpm ``` **Physiological Justification:** - Low hemoglobin → less oxygen delivery → heart pumps faster - Sickle cell disease → chronic tissue hypoxia → elevated HR - Smoking → nicotine stimulation → increased HR - Acute malaria → fever and illness → increased HR **Example Cases:** ``` Case 1: Normal Hb (14 g/dL), no conditions HR = 72 + 0 + 0 + 0 + 0 + ε = ~72 bpm ✓ Normal Case 2: Low Hb (8 g/dL) from SCD, non-smoker HR = 72 + 20 + 15 + 0 + 0 + ε = ~107 bpm ✓ Compensatory Case 3: Normal Hb, smoker, recent malaria HR = 72 + 0 + 0 + 10 + 15 + ε = ~97 bpm ✓ Elevated Case 4: SCD + smoker + recent malaria (very sick) HR = 72 + 20 + 15 + 10 + 15 + ε = ~132 bpm ✓ Tachycardia ``` --- #### 5.3 Blood Pressure ```python BloodPressure = DetermineHypertension(Age, Location, Sex) + SmokingEffect(IsSmoker) + SickleCellVariability(Genotype) Where: P(Hypertension) = BaselinePrevalence(Location) × AgeMultiplier(AgeGroup) BaselinePrevalence: Urban: 0.38 Rural: 0.28 AgeMultiplier: 18-34: ×0.5 (16-19% prevalence) 35-54: ×1.0 (28-38% prevalence) 55+: ×1.8 (50-68% prevalence) If Hypertensive: 70% → Stage 1: Systolic 130-145, Diastolic 80-95 30% → Stage 2: Systolic 145-180, Diastolic 95-115 If Normotensive: Systolic: 100-128 mmHg Diastolic: 60-82 mmHg SmokingEffect: +5 to +15 systolic +3 to +8 diastolic SickleCellEffect (SS): ±10 to ±20 systolic (vascular damage, variable) ``` **Clinical Justification:** - Nigeria has high HTN prevalence (32% overall) - Urban > rural (diet, stress, sedentary lifestyle) - Strong age gradient (vessels stiffen with age) - Smoking raises BP (vasoconstriction) - Sickle cell causes vascular damage (unpredictable BP) --- #### 5.4 Cholesterol ```python Cholesterol = BaselineChol(Location) + AgeEffect(Age) + SexEffect(Sex) + RandomVariation Where: BaselineChol: Urban ~ Normal(230, 35) mg/dL ← Western diet Rural ~ Normal(200, 30) mg/dL ← Traditional diet AgeEffect: +(Age - 30) × 0.5 mg/dL SexEffect: Male: +0 to +10 mg/dL Female: +0 mg/dL Final range: 120 - 400 mg/dL ``` **Justification:** - Nutrition transition in urban Nigeria (more processed food) - Traditional rural diets → lower cholesterol - Age-related increase is universal - Males slightly higher (hormonal differences) --- ## Special Interactions Modeled ### 1. Smoking × Sickle Cell Disease ```python if Genotype == 'SS': P(Smoker) = 0.01 # Extremely rare (<1%) Justification: - Smoking triggers vaso-occlusive crises - Reduced oxygen → sickling → pain crisis - Most SCD patients educated to avoid smoking ``` ### 2. Sickle Cell Trait × Malaria (Protective Effect) ```python if Genotype == 'AS' and MalariaExposure == 'high': Severity = 'mild' # Trait provides protection Justification: - Evolutionary advantage in malaria-endemic areas - AS genotype reduces parasite multiplication - 50-90% protection against severe/cerebral malaria - This is WHY sickle cell trait persists at 24% ``` ### 3. Multiple Comorbidities (Multiplicative Risk) ```python if Smoker and Genotype == 'SS': StrokeRisk = BaselineRisk × 15 # Catastrophic if Smoker and Hypertensive and Age > 55: CVDRisk = BaselineRisk × 8 # Very high if Genotype == 'SS' and MalariaRecent: CrisisRisk = BaselineRisk × 5 # Triggers crisis HospitalizationNeeded = True ``` --- ## Validation Strategy ### 1. Population-Level Validation After generation, verify aggregate statistics match targets: ```python Target vs Achieved: Smoking prevalence: 5.0% ± 0.3% ✓ Male smoking: 9.0% ± 0.5% ✓ Female smoking: 1.0% ± 0.2% ✓ AS genotype: 22% ± 1% ✓ SS genotype: 2% ± 0.3% ✓ Hypertension: 32% ± 2% ✓ Mean age: 38-40 years ✓ ``` ### 2. Conditional Relationship Validation Verify expected correlations exist: ```python Correlation tests: Hemoglobin vs Heart Rate: Negative ✓ (lower Hb → higher HR) Age vs Blood Pressure: Positive ✓ (older → higher BP) Smoking vs Heart Rate: Positive ✓ (smokers → higher HR) SCD vs Hemoglobin: Negative ✓ (SS → much lower Hb) ``` ### 3. Clinical Plausibility Checks ```python Flag impossible combinations: - Hb > 18 g/dL → Polycythemia (rare, check) - Hb < 6 g/dL → Life-threatening (should be hospitalized) - BP > 200/120 → Hypertensive emergency - SS genotype + Hb > 12 → Implausible (investigate) ``` --- ## Advantages of This Methodology ### 1. **Realistic Feature Interactions** - Traditional synthetic data: Features generated independently - This approach: Conditional probabilities model real biology - ML models: Will learn actual disease relationships ### 2. **Population Heterogeneity** - Not all smokers are unhealthy - Not all non-smokers are healthy - Sickle cell, malaria, hypertension create varied profiles - Reflects real-world medical complexity ### 3. **Regional Variations** - Urban Lagos ≠ Rural Sokoto - Dataset captures geographic health disparities - Useful for policy targeting and resource allocation ### 4. **Research Validity** - Every parameter traceable to published research - Transparent methodology enables critique and improvement - Suitable for academic publication and peer review ### 5. **Educational Value** - Teaches epidemiological thinking - Shows how risk factors interact - Demonstrates population vs individual risk --- ## Limitations & Assumptions ### 1. **Simplified Disease Models** - Real biology is more complex - We model major effects, not every pathway - Chronic diseases (diabetes, TB, HIV) not yet included ### 2. **Static Snapshot** - Dataset represents one point in time - Doesn't model disease progression or aging - No longitudinal follow-up ### 3. **Independence Assumptions** - Some factors assumed independent when data unavailable - Example: Cholesterol independent of sickle cell status (Real relationship unclear from literature) ### 4. **Regional Aggregation** - Geopolitical zones aggregate many states - Within-region variation exists but not modeled - Assumes homogeneity within urban/rural categories ### 5. **Missing Confounders** - Socioeconomic status (SES) affects health - Education level correlates with smoking - Occupation affects exposure risks - These are not included (yet) --- ## Future Enhancements ### Potential Additions: 1. **Additional Comorbidities** - Diabetes prevalence (urban: 5-8%) - HIV/AIDS (1.3% overall, regional variation) - Tuberculosis co-infection with HIV - Chronic kidney disease 2. **Socioeconomic Factors** - Education level (affects health literacy) - Income quintile (affects healthcare access) - Occupation (exposure risks) 3. **Healthcare Access** - Distance to nearest hospital - Health insurance status (NHIS coverage: ~5%) - Traditional vs modern medicine use 4. **Temporal Dynamics** - Season (malaria seasonality) - Time since last medical visit - Disease progression trajectories 5. **Medication Effects** - Antihypertensive use (but adherence is low) - Antimalarial prophylaxis - Hydroxyurea for SCD (improves Hb) --- ## Technical Implementation Notes ### Random Seed - Set to 42 for reproducibility - All probabilistic steps use numpy.random with fixed seed - Regenerating with same seed → identical dataset ### Performance - Generates 3,900 records in ~5-10 seconds - Scalable to millions of records - Vectorization possible but not implemented (prioritized readability) ### Code Structure ``` nigerianize_smoking_health_dataset.py ├─ Constants (prevalence rates, names) ├─ Helper functions (one per factor) ├─ Main transformation function (orchestrates) └─ Validation & summary statistics ``` ### Output Formats - CSV: Human-readable, universal compatibility - Parquet: Compressed, efficient for analytics - Both contain identical data --- ## Conclusion This methodology demonstrates how to create **scientifically valid synthetic health data** using: - ✅ Evidence-based probability distributions - ✅ Conditional relationships from clinical research - ✅ Multi-factor disease modeling - ✅ Population-level validation - ✅ Transparent, reproducible process The result is a dataset that: - Reflects Nigerian epidemiological reality - Contains realistic feature interactions - Supports both research and education - Can be extended with additional factors - Is fully documented and reproducible --- **Document Version:** 1.0 **Last Updated:** October 2025 **Authors:** electricsheepafrica **License:** CC-BY-4.0 (documentation), MIT (dataset)