Nigeria-smoking-health / METHODOLOGY.md
Kossisoroyce's picture
Upload folder using huggingface_hub
6e51d52 verified

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

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

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

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

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

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)

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)

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:

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:

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

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)