5.14. Step 14: Child Mortality

5.14.1. Model Description

At this step we add an optional module for child mortality based on detailed individual characteristics. The outcome can be calibrated for a base year and various options are available how the module is to be used in combination with the base mortality module.

5.14.2. The new ChildMortality.mpp Module

This module implements infant and child mortality (at ages 0-4). The child mortality module is based on a proportional hazard regression model consisting of a

  • Mortality baseline by age and sex
  • Relative risks by age for individual level characteristics.
  • A time trend by age

The module is optional, and the user can choose between various options:

  • Disable the child mortality model: the same model as for all ages is used.
  • Child mortality model without alignment: the child mortality module replaces the overall mortality module for ages 0-4. Note, that the overall life expectancy might be altered by this choice.
  • Child mortality model calibrated for an initial year, then trends as for other ages: In this choice, life expectancy is the same as in the overall mortality for the given year, but as the composition of the population by mothers’ characteristics changes over time, the number of deaths (and therefore life expectancy) will be different for the following years, allowing for scenario comparisons.
  • Child mortality model calibrated for an initial year, then specific trends from the child mortality module: In this choice, life expectancy is the same as in the overall mortality for the given year, but as the composition of the population by mothers’ characteristics changes over time, and as a result from potentially different trends, the number of deaths (and therefore life expectancy) will be different for the following years, allowing for scenario comparisons.

If activated, the model for child mortality starts replacing the overall mortality model five calendar years after the starting year of the simulation, which is when the first five cohorts ar eborn in the simulation and are then age 0-4. As mother’s characteristics are not available for children born outside the country, immigrants are excluded from the model and handled by the general mortality module.

This module is optional and can be removed without damage to the model. It requires a state mother_age_at_birth which is initialized in the Start() function.

The implementation of child mortality includes functions of three different actors.

  • The Globals actor is used to calibrate the model and to store the calibrated baseline mortality hazards
  • The Clock actor is used to schedule the calibration
  • The Person actor handles the alternative mortality event.

How to change or add the population groups for relative risks?

The list of population groups for which relative risks are applied is generic and can be modified and extended easily. Currently we distinguish nine groups by mother’s education and mother’s age group.

  • The classification CHILD_MORTALITY_GROUP lists all population groups distinguished.
  • The state child_mortality_group contains the individual group membership and has to be adapted if the list of categories is modified.

Besides these two changes no coding is required. The calibration routine automatically adjusts the baseline hazards according to the population composition by group membership and the corresponding relative risks.



////////////////////////////////////////////////////////////////////////////////////////////////////
// Types
////////////////////////////////////////////////////////////////////////////////////////////////////

classification SELECTED_CHILD_MORTALITY_MODEL   //EN Child Mortality Model Options
{
    SCMM_MACRO,                                 //EN Disable child mortality model
    SCMM_MICRO_NOT_ALIGNED,                     //EN Child mortality model without alignment
    SCMM_MICRO_ALIGNED_MACRO_TRENDS,            //EN Aligned, trends as for other ages
    SCMM_MICRO_ALIGNED_MICRO_TRENDS             //EN Aligned, trends from child mortality model
};

classification CHILD_MORTALITY_GROUP            //EN Relative risks for child mortality
{
    CMG_00,                                     //EN Mother age 17+ completed primary
    CMG_01,                                     //EN Mother age 17+, primary dropout
    CMG_02,                                     //EN Mother age 17+, neve entered primary
    CMG_03,                                     //EN Mother age 15-16, completed primary
    CMG_04,                                     //EN Mother age 15-16, primary dropout
    CMG_05,                                     //EN Mother age 15-16, neve entered primary
    CMG_06,                                     //EN Mother age <15, completed primary
    CMG_07,                                     //EN Mother age <15, primary dropout
    CMG_08                                      //EN Mother age <15, neve entered primary
};

range CHILD_MORTALITY_AGE { 0, 4 };             //EN Age range for child mortality

////////////////////////////////////////////////////////////////////////////////////////////////////
// Parameters
////////////////////////////////////////////////////////////////////////////////////////////////////

parameters
{
    //EN Child mortality model selection
    SELECTED_CHILD_MORTALITY_MODEL  SelectedChildMortalityModel;

    //EN Child mortality baseline risk
    double  ChildMortalityBaseRisk[CHILD_MORTALITY_AGE][SEX];

    //EN Child mortality relative risk
    double  ChildMortalityRelativeRisks[CHILD_MORTALITY_AGE][CHILD_MORTALITY_GROUP];

    //EN Child mortality time trend
    double ChildMortalityTrend[CHILD_MORTALITY_AGE][CHILD_MORTALITY_YEARS];
};

parameter_group PG_ChildMortality               //EN Child Mortality
{
    ChildMortalityBaseRisk,
    ChildMortalityRelativeRisks, ChildMortalityTrend
};

parameter_group PG_Mortality                    //EN Mortality
{
    SelectedChildMortalityModel,
    PG02_OverallMortality,
    PG_ChildMortality
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Actor Globals
////////////////////////////////////////////////////////////////////////////////////////////////////

actor Globals
{
    double mort_male_0;                         //EN Child mortality risk male age 0
    double mort_male_1;                         //EN Child mortality risk male age 1
    double mort_male_2;                         //EN Child mortality risk male age 2
    double mort_male_3;                         //EN Child mortality risk male age 3
    double mort_male_4;                         //EN Child mortality risk male age 4

    double mort_female_0;                       //EN Child mortality risk female age 0
    double mort_female_1;                       //EN Child mortality risk female age 1
    double mort_female_2;                       //EN Child mortality risk female age 2
    double mort_female_3;                       //EN Child mortality risk female age 3
    double mort_female_4;                       //EN Child mortality risk female age 4

    void ChildMortalityCalibration();           //EN Child mortality calibration
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Actor Clock
////////////////////////////////////////////////////////////////////////////////////////////////////

actor Clock
{
    void CallChildMortalityCalibration();                   //EN Clock for calling calibration
    hook CallChildMortalityCalibration, StartYearClock;     //EN Hooked to Start Year
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Actor Person
////////////////////////////////////////////////////////////////////////////////////////////////////

actor Person
{
    //EN Mothers age at own birth
    double mother_age_at_birth = { 999 };

    //EN Child mortality risk group
    CHILD_MORTALITY_GROUP child_mortality_group =
        ( mother_age_at_birth >= 17 && educ_mother == EOL_HIGH )   ? CMG_00 :  // 17+ completed
        ( mother_age_at_birth >= 17 && educ_mother == EOL_MEDIUM ) ? CMG_01 :  // 17+ dropout
        ( mother_age_at_birth >= 17 && educ_mother == EOL_LOW )    ? CMG_02 :  // 17+ non
        ( mother_age_at_birth >= 15 && educ_mother == EOL_HIGH )   ? CMG_03 :  // 15-16 completed
        ( mother_age_at_birth >= 15 && educ_mother == EOL_MEDIUM ) ? CMG_04 :  // 15-16 dropout
        ( mother_age_at_birth >= 15 && educ_mother == EOL_LOW )    ? CMG_05 :  // 15-16 non
        ( educ_mother == EOL_HIGH )                                ? CMG_06 :  // <15 completed
        ( educ_mother == EOL_MEDIUM )                              ? CMG_07 :  // <15 dropout
        CMG_08;                                                                // <15 non


   //EN Baseline mortality
    double child_mortality =
        (integer_age == 0 && sex == MALE) ? lGlobals->mort_male_0 :
        (integer_age == 1 && sex == MALE) ? lGlobals->mort_male_1 :
        (integer_age == 2 && sex == MALE) ? lGlobals->mort_male_2 :
        (integer_age == 3 && sex == MALE) ? lGlobals->mort_male_3 :
        (integer_age == 4 && sex == MALE) ? lGlobals->mort_male_4 :
        (integer_age == 0 && sex == FEMALE) ? lGlobals->mort_female_0 :
        (integer_age == 1 && sex == FEMALE) ? lGlobals->mort_female_1 :
        (integer_age == 2 && sex == FEMALE) ? lGlobals->mort_female_2 :
        (integer_age == 3 && sex == FEMALE) ? lGlobals->mort_female_3 :
        (integer_age == 4 && sex == FEMALE) ? lGlobals->mort_female_4 : 0.0;

    //EN Child mortality event
    event timeChildMortalityEvent, ChildMortalityEvent;

    //EN Activates Module at birth if selected and relevant
    void ActivateChildMortalityModule();
    hook ActivateChildMortalityModule, Start;

    // EN Deactivates Module at 5th birthday if selected and relevant
    void DeActivateChildMortalityModule();
    hook DeActivateChildMortalityModule, BirthdayEvent;
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Person functions implementation
////////////////////////////////////////////////////////////////////////////////////////////////////

void Person::ActivateChildMortalityModule()
{
    if (person_type == PT_CHILD && year_of_birth >= MIN(CHILD_MORTALITY_YEARS)
        && SelectedChildMortalityModel != SCMM_MACRO)
    {
        use_base_mortality = FALSE;
    }
}

void Person::DeActivateChildMortalityModule()
{
    if (!use_base_mortality && integer_age > MAX(CHILD_MORTALITY_AGE))
    {
        use_base_mortality = TRUE;
    }
}

TIME Person::timeChildMortalityEvent()
{
    double dEventTime = TIME_INFINITE;
    double dHazard = 0.0;

    if (!use_base_mortality && in_projected_time && ever_resident)
    {
        // base risk * trend
        // unaligned model
        if (SelectedChildMortalityModel == SCMM_MICRO_NOT_ALIGNED)
        {
            dHazard = ChildMortalityBaseRisk[integer_age][sex]
                * ChildMortalityTrend[integer_age][RANGE_POS(CHILD_MORTALITY_YEARS, calendar_year)];
        }

        // aligned with overall trend
        else if (SelectedChildMortalityModel == SCMM_MICRO_ALIGNED_MACRO_TRENDS)
        {
            dHazard = child_mortality
                * MortalityTrend[RANGE_POS(SIM_YEAR_RANGE, calendar_year)][sex]
                / MortalityTrend[RANGE_POS(SIM_YEAR_RANGE, MIN(CHILD_MORTALITY_YEARS))][sex];
        }

        // aligned with specific child mortality trend
        else
        {
            dHazard = child_mortality
                * ChildMortalityTrend[integer_age][RANGE_POS(CHILD_MORTALITY_YEARS, calendar_year)];
        }

        // relativ risks
        dHazard = dHazard * ChildMortalityRelativeRisks[integer_age][child_mortality_group];

        // if hazard is positive calculate event time
        if (dHazard > 0) dEventTime = WAIT(-log(RandUniform(31)) / dHazard);;
    }
    return dEventTime;
}

void Person::ChildMortalityEvent()
{
    MortalityEvent();
}

////////////////////////////////////////////////////////////////////////////////////////////////////
// Clock functions implementation
////////////////////////////////////////////////////////////////////////////////////////////////////

void Clock::CallChildMortalityCalibration()
{
    // Call the calibration if required
    if (clock_year == MIN(CHILD_MORTALITY_YEARS) &&
        (SelectedChildMortalityModel == SCMM_MICRO_ALIGNED_MACRO_TRENDS
            || SelectedChildMortalityModel == SCMM_MICRO_ALIGNED_MICRO_TRENDS))
    {
        asGlobals->Item(0)->ChildMortalityCalibration();
    }
    // Activate the child mortality module on person level if required
    if (clock_year == MIN(CHILD_MORTALITY_YEARS) && SelectedChildMortalityModel != SCMM_MACRO)
    {
        for (long nJ = 0; nJ < asAllPersons->Count(); nJ++)
        {
            auto prPerson = asAllPersons->Item(nJ);
            if (prPerson->integer_age <= MAX(CHILD_MORTALITY_AGE) && prPerson->person_type==PT_CHILD
                && prPerson->use_base_mortality)
            {
                prPerson->use_base_mortality = FALSE ;
            }
        }
    }
}

////////////////////////////////////////////////////////////////////////////////////////////////////
// Globals functions implementation
////////////////////////////////////////////////////////////////////////////////////////////////////

void Globals::ChildMortalityCalibration()
{
    // local matrices
    double dDeaths[SIZE(CHILD_MORTALITY_AGE)][SIZE(SEX)];      // Number expected deaths
    double dProb[SIZE(CHILD_MORTALITY_AGE)][SIZE(SEX)];        // Death probability
    double dBase[SIZE(CHILD_MORTALITY_AGE)][SIZE(SEX)];        // Baseline Hazard in simulation
    long   nPop[SIZE(CHILD_MORTALITY_AGE)][SIZE(SEX)][SIZE(CHILD_MORTALITY_GROUP)]; // Pop sizes

    // Initialize matrices
    // set population sizes nPop and expected deaths nDeaths to 0
    // sets death probabilities dProb by age and sex for the year in which the model is calibrated
    for (int nAge = 0; nAge < SIZE(CHILD_MORTALITY_AGE); nAge++)
    {
        for (int nSex = 0; nSex < SIZE(SEX); nSex++)
        {
            dProb[nAge][nSex] = 1.0 - exp(-MortalityTable[nAge][nSex]
                * MortalityTrend[RANGE_POS(SIM_YEAR_RANGE, MIN(CHILD_MORTALITY_YEARS))][nSex]);
            dDeaths[nAge][nSex] = 0.0;
            for (int nGroup = 0; nGroup < SIZE(CHILD_MORTALITY_GROUP); nGroup++)
            {
                nPop[nAge][nSex][nGroup] = 0.0;
            }
        }
    }

    // Population Count
    // calculates population sizes nPop by age, sex, risk group
    // calculates expected deaths dDeaths by age and sex
    for (long nJ = 0; nJ < asAllPersons->Count(); nJ++)
    {
        auto prPerson = asAllPersons->Item(nJ);
        if (prPerson->integer_age <= MAX(CHILD_MORTALITY_AGE) && prPerson->person_type==PT_CHILD)
        {
            dDeaths[prPerson->integer_age][prPerson->sex] = dDeaths[prPerson->integer_age][prPerson->sex] + dProb[prPerson->integer_age][prPerson->sex];
            nPop[prPerson->integer_age][prPerson->sex][prPerson->child_mortality_group]++;
        }
    }

    // find calibrated baselines
    for (int nAge = 0; nAge < SIZE(CHILD_MORTALITY_AGE); nAge++)
    {
        for (int nSex = 0; nSex < SIZE(SEX); nSex++)
        {
            double  dUpper = 2.0;
            double  dLower = 0.0;
            double  dCenter = 1.0;
            double  dNumberDeaths = 0.0;
            int     nIterations = 10000;

            while ( abs(dNumberDeaths - dDeaths[nAge][nSex]) > 0.0001 && nIterations > 0 )
            {
                nIterations--;
                dBase[nAge][nSex] = ( dLower + dUpper) / 2.0;

                dNumberDeaths = 0.0;

                //Celculate numer of deaths for given dBase
                for (int nGroup = 0; nGroup < SIZE(CHILD_MORTALITY_GROUP); nGroup++)
                {
                    dNumberDeaths = dNumberDeaths + nPop[nAge][nSex][nGroup]
                        * (1-exp(-dBase[nAge][nSex] *  ChildMortalityRelativeRisks[nAge][nGroup]));
                }
                // shrink search interval
                if ( dNumberDeaths > dDeaths[nAge][nSex]) dUpper = dBase[nAge][nSex];
                else dLower = dBase[nAge][nSex];
            }
        }
    }

    // set states
    mort_male_0 = dBase[0][MALE]; mort_female_0 = dBase[0][FEMALE];
    mort_male_1 = dBase[1][MALE]; mort_female_1 = dBase[1][FEMALE];
    mort_male_2 = dBase[2][MALE]; mort_female_2 = dBase[2][FEMALE];
    mort_male_3 = dBase[3][MALE]; mort_female_3 = dBase[3][FEMALE];
    mort_male_4 = dBase[4][MALE]; mort_female_4 = dBase[4][FEMALE];
}

5.14.3. Initializations in the Start() Function

The states mothers_age_at_birth is initiated in the Start() Function for actors born in teh simulation.


        mother_age_at_birth = pePers->age;