Step 19: NTA Validation

Overview

At this step we add an optional module for the validation of NTA variables.

The new NtaValidation.mpp Module

The NTA Validation Module is an optional module introducing a set of validation tables comparing the aggregate outcome of NTA variables by education and family type with published aggregates by sex a/o age. For each of the 19 NTA variables, a table is produced comparing aggregated simulated values in the starting year with published NTA values and providing aggregate simulated outcomes by education group. Also a table of the population composition by all considered dimensions (age, sex, education, family type) is produced. This module can be removed to save memory space.



////////////////////////////////////////////////////////////////////////////////////////////////////
// Dymensions
////////////////////////////////////////////////////////////////////////////////////////////////////

range TAB_FAM_INDEX { 0,5 }; //EN Family Index

////////////////////////////////////////////////////////////////////////////////////////////////////
// Actor states
////////////////////////////////////////////////////////////////////////////////////////////////////

actor Person
{
    //EN Family Index
    TAB_FAM_INDEX tab_fam_index = (nta_pop_group == NPG_OLD) ?
        COERCE(TAB_FAM_INDEX, nta_old_index) : COERCE(TAB_FAM_INDEX, nta_fam_index);

    // NTA by age only
    double age_CFE = NtaAge[integer_age][CFE];              //EN CFE by age
    double age_CFH = NtaAge[integer_age][CFH];              //EN CFH by age
    double age_CFX = NtaAge[integer_age][CFX];              //EN CFX by age
    double age_CGE = NtaAge[integer_age][CGE];              //EN CGE by age
    double age_CGH = NtaAge[integer_age][CGH];              //EN CGH by age
    double age_CGX = NtaAge[integer_age][CGX];              //EN CGX by age
    double age_TGSOAI = NtaAge[integer_age][TGSOAI];        //EN TGSOAI by age
    double age_TGXCI = NtaAge[integer_age][TGXCI];          //EN TGXCI by age
    double age_TGXII = NtaAge[integer_age][TGXII];          //EN TGXII by age
    double age_TGEI = NtaAge[integer_age][TGEI];            //EN TGEI by age
    double age_TGHI = NtaAge[integer_age][TGHI];            //EN TGHI by age
    double age_TGO = NtaAge[integer_age][TGO];              //EN TGO by age
    double age_TFB = NtaAge[integer_age][TFB];              //EN TFB by age
    double age_TFW = NtaAge[integer_age][TFW];              //EN TFW by age
    double age_SF = NtaAge[integer_age][SF];                //EN SF by age
    double age_SG = NtaAge[integer_age][SG];                //EN SG by age
    double age_YL = NtaAge[integer_age][YL];                //EN LY by age
    double age_YAF = NtaAge[integer_age][YAF];              //EN YAF by age
    double age_YAG = NtaAge[integer_age][YAG];              //EN YAG by age

    // NTA by age and sex
    double sex_CFE = NtaSex[sex][integer_age][CFE];         //EN CFE by age and sex
    double sex_CFH = NtaSex[sex][integer_age][CFH];         //EN CFH by age and sex
    double sex_CFX = NtaSex[sex][integer_age][CFX];         //EN CFX by age and sex
    double sex_CGE = NtaSex[sex][integer_age][CGE];         //EN CGE by age and sex
    double sex_CGH = NtaSex[sex][integer_age][CGH];         //EN CGH by age and sex
    double sex_CGX = NtaSex[sex][integer_age][CGX];         //EN CGX by age and sex
    double sex_TGSOAI = NtaSex[sex][integer_age][TGSOAI];   //EN TGSOAI by age and sex
    double sex_TGXCI = NtaSex[sex][integer_age][TGXCI];     //EN TGXCI by age and sex
    double sex_TGXII = NtaSex[sex][integer_age][TGXII];     //EN TGXII by age and sex
    double sex_TGEI = NtaSex[sex][integer_age][TGEI];       //EN TGEI by age and sex
    double sex_TGHI = NtaSex[sex][integer_age][TGHI];       //EN TGHI by age and sex
    double sex_TGO = NtaSex[sex][integer_age][TGO];         //EN TGO by age and sex
    double sex_TFB = NtaSex[sex][integer_age][TFB];         //EN TFB by age and sex
    double sex_TFW = NtaSex[sex][integer_age][TFW];         //EN TFW by age and sex
    double sex_SF = NtaSex[sex][integer_age][SF];           //EN SF by age and sex
    double sex_SG = NtaSex[sex][integer_age][SG];           //EN SG by age and sex
    double sex_YL = NtaSex[sex][integer_age][YL];           //EN LY by age and sex
    double sex_YAF = NtaSex[sex][integer_age][YAF];         //EN YAF by age and sex
    double sex_YAG = NtaSex[sex][integer_age][YAG];         //EN YAG by age and sex
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Validation Tables
////////////////////////////////////////////////////////////////////////////////////////////////////

table_group TG_NTA_ValidationTables     //EN NTA Validation Tables
{
    TabNtaValidation_CFE, TabNtaValidation_CFH, TabNtaValidation_CFX, TabNtaValidation_CGE,
    TabNtaValidation_CGH, TabNtaValidation_CGX, TabNtaValidation_TGSOAI, TabNtaValidation_TGXCI,
    TabNtaValidation_TGXII, TabNtaValidation_TGEI, TabNtaValidation_TGHI, TabNtaValidation_TGO,
    TabNtaValidation_TFB, TabNtaValidation_TFW, TabNtaValidation_SF, TabNtaValidation_SG,
    TabNtaValidation_YL, TabNtaValidation_YAF, TabNtaValidation_YAG, TabNtaPopulation2010
};

table Person TabNtaValidation_CFE                                               //EN CFE Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_CFE) / duration(),                               //EN CFE
        weighted_duration(sex,FEMALE, base_CFE) / duration(sex,FEMALE),         //EN CFE female
        weighted_duration(sex,MALE, base_CFE) / duration(sex,MALE),             //EN CFE male

        weighted_duration(nta_educ,EL3_LOW, base_CFE) / duration(nta_educ,EL3_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_CFE) / duration(nta_educ,EL3_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_CFE) / duration(nta_educ,EL3_HIGH),    //EN CFE educ high

        weighted_duration(sex,FEMALE,sex_CFE) / duration(sex,FEMALE),           //EN Agenta CFE female
        weighted_duration(sex,MALE,sex_CFE) / duration(sex,MALE),               //EN Agenta CFE male
        weighted_duration(age_CFE) / duration()                                 //EN Agenta CFE by age
    }
    * integer_age
};

table Person TabNtaValidation_CFH                                               //EN CFH Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_CFH) / duration(),                               //EN CFH
        weighted_duration(sex,FEMALE, base_CFH) / duration(sex,FEMALE),         //EN CFH female
        weighted_duration(sex,MALE, base_CFH) / duration(sex,MALE),             //EN CFH male

        weighted_duration(nta_educ,EL3_LOW, base_CFH) / duration(nta_educ,EL3_LOW),     //EN CFH educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_CFH) / duration(nta_educ,EL3_MEDIUM),  //EN CFH educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_CFH) / duration(nta_educ,EL3_HIGH),    //EN CFH educ high

        weighted_duration(sex,FEMALE,sex_CFH) / duration(sex,FEMALE),           //EN Agenta CFH female
        weighted_duration(sex,MALE,sex_CFH) / duration(sex,MALE),               //EN Agenta CFH male
        weighted_duration(age_CFH) / duration()                                 //EN Agenta CFH by age
    }
    * integer_age
};

table Person TabNtaValidation_CFX                                               //EN CFX Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_CFX) / duration(),                               //EN CFX
        weighted_duration(sex,FEMALE, base_CFX) / duration(sex,FEMALE),         //EN CFX female
        weighted_duration(sex,MALE, base_CFX) / duration(sex,MALE),             //EN CFX male

        weighted_duration(nta_educ,EL3_LOW, base_CFX) / duration(nta_educ,EL3_LOW),     //EN CFX educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_CFX) / duration(nta_educ,EL3_MEDIUM),  //EN CFX educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_CFX) / duration(nta_educ,EL3_HIGH),    //EN CFX educ high

        weighted_duration(sex,FEMALE,sex_CFX) / duration(sex,FEMALE),           //EN Agenta CFX female
        weighted_duration(sex,MALE,sex_CFX) / duration(sex,MALE),               //EN Agenta CFX male
        weighted_duration(age_CFX) / duration()                                 //EN Agenta CFX by age
    }
    * integer_age
};

table Person TabNtaValidation_CGE                                               //EN CGE Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_CGE) / duration(),                               //EN CGE
        weighted_duration(sex,FEMALE, base_CGE) / duration(sex,FEMALE),         //EN CGE female
        weighted_duration(sex,MALE, base_CGE) / duration(sex,MALE),             //EN CGE male

        weighted_duration(nta_educ,EL3_LOW, base_CGE) / duration(nta_educ,EL3_LOW),     //EN CGE educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_CGE) / duration(nta_educ,EL3_MEDIUM),  //EN CGE educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_CGE) / duration(nta_educ,EL3_HIGH),    //EN CGE educ high

        weighted_duration(sex,FEMALE,sex_CGE) / duration(sex,FEMALE),           //EN Agenta CGE female
        weighted_duration(sex,MALE,sex_CGE) / duration(sex,MALE),               //EN Agenta CGE male
        weighted_duration(age_CGE) / duration()                                 //EN Agenta CGE by age
    }
    * integer_age
};


table Person TabNtaValidation_CGH                                               //EN CGH Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_CGH) / duration(),                               //EN CGH
        weighted_duration(sex,FEMALE, base_CGH) / duration(sex,FEMALE),         //EN CGH female
        weighted_duration(sex,MALE, base_CGH) / duration(sex,MALE),             //EN CGH male

        weighted_duration(nta_educ,EL3_LOW, base_CGH) / duration(nta_educ,EL3_LOW),     //EN CGH educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_CGH) / duration(nta_educ,EL3_MEDIUM),  //EN CGH educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_CGH) / duration(nta_educ,EL3_HIGH),    //EN CGH educ high

        weighted_duration(sex,FEMALE,sex_CGH) / duration(sex,FEMALE),           //EN Agenta CGH female
        weighted_duration(sex,MALE,sex_CGH) / duration(sex,MALE),               //EN Agenta CGH male
        weighted_duration(age_CGH) / duration()                                 //EN Agenta CGH by age
    }
    * integer_age
};


table Person TabNtaValidation_CGX                                               //EN CGX Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_CGX) / duration(),                               //EN CGX
        weighted_duration(sex,FEMALE, base_CGX) / duration(sex,FEMALE),         //EN CGX female
        weighted_duration(sex,MALE, base_CGX) / duration(sex,MALE),             //EN CGX male

        weighted_duration(nta_educ,EL3_LOW, base_CGX) / duration(nta_educ,EL3_LOW),     //EN CGX educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_CGX) / duration(nta_educ,EL3_MEDIUM),  //EN CGX educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_CGX) / duration(nta_educ,EL3_HIGH),    //EN CGX educ high

        weighted_duration(sex,FEMALE,sex_CGX) / duration(sex,FEMALE),           //EN Agenta CGX female
        weighted_duration(sex,MALE,sex_CGX) / duration(sex,MALE),               //EN Agenta CGX male
        weighted_duration(age_CGX) / duration()                                 //EN Agenta CGX by age
    }
    * integer_age
};

table Person TabNtaValidation_TGSOAI                                               //EN TGSOAI Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_TGSOAI) / duration(),                               //EN TGSOAI
        weighted_duration(sex,FEMALE, base_TGSOAI) / duration(sex,FEMALE),         //EN TGSOAI female
        weighted_duration(sex,MALE, base_TGSOAI) / duration(sex,MALE),             //EN TGSOAI male

        weighted_duration(nta_educ,EL3_LOW, base_TGSOAI) / duration(nta_educ,EL3_LOW),     //EN TGSOAI educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_TGSOAI) / duration(nta_educ,EL3_MEDIUM),  //EN TGSOAI educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_TGSOAI) / duration(nta_educ,EL3_HIGH),    //EN TGSOAI educ high

        weighted_duration(sex,FEMALE,sex_TGSOAI) / duration(sex,FEMALE),           //EN Agenta TGSOAI female
        weighted_duration(sex,MALE,sex_TGSOAI) / duration(sex,MALE),               //EN Agenta TGSOAI male
        weighted_duration(age_TGSOAI) / duration()                                 //EN Agenta TGSOAI by age
    }
    * integer_age
};

table Person TabNtaValidation_TGXCI                                               //EN TGXCI Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_TGXCI) / duration(),                               //EN TGXCI
        weighted_duration(sex,FEMALE, base_TGXCI) / duration(sex,FEMALE),         //EN TGXCI female
        weighted_duration(sex,MALE, base_TGXCI) / duration(sex,MALE),             //EN TGXCI male

        weighted_duration(nta_educ,EL3_LOW, base_TGXCI) / duration(nta_educ,EL3_LOW),     //EN TGXCI educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_TGXCI) / duration(nta_educ,EL3_MEDIUM),  //EN TGXCI educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_TGXCI) / duration(nta_educ,EL3_HIGH),    //EN TGXCI educ high

        weighted_duration(sex,FEMALE,sex_TGXCI) / duration(sex,FEMALE),           //EN Agenta TGXCI female
        weighted_duration(sex,MALE,sex_TGXCI) / duration(sex,MALE),               //EN Agenta TGXCI male
        weighted_duration(age_TGXCI) / duration()                                 //EN Agenta TGXCI by age
    }
    * integer_age
};

table Person TabNtaValidation_TGXII                                               //EN TGXII Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_TGXII) / duration(),                               //EN TGXII
        weighted_duration(sex,FEMALE, base_TGXII) / duration(sex,FEMALE),         //EN TGXII female
        weighted_duration(sex,MALE, base_TGXII) / duration(sex,MALE),             //EN TGXII male

        weighted_duration(nta_educ,EL3_LOW, base_TGXII) / duration(nta_educ,EL3_LOW),     //EN TGXII educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_TGXII) / duration(nta_educ,EL3_MEDIUM),  //EN TGXII educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_TGXII) / duration(nta_educ,EL3_HIGH),    //EN TGXII educ high

        weighted_duration(sex,FEMALE,sex_TGXII) / duration(sex,FEMALE),           //EN Agenta TGXII female
        weighted_duration(sex,MALE,sex_TGXII) / duration(sex,MALE),               //EN Agenta TGXII male
        weighted_duration(age_TGXII) / duration()                                 //EN Agenta TGXII by age
    }
    * integer_age
};

table Person TabNtaValidation_TGEI                                               //EN TGEI Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_TGEI) / duration(),                               //EN TGEI
        weighted_duration(sex,FEMALE, base_TGEI) / duration(sex,FEMALE),         //EN TGEI female
        weighted_duration(sex,MALE, base_TGEI) / duration(sex,MALE),             //EN TGEI male

        weighted_duration(nta_educ,EL3_LOW, base_TGEI) / duration(nta_educ,EL3_LOW),     //EN TGEI educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_TGEI) / duration(nta_educ,EL3_MEDIUM),  //EN TGEI educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_TGEI) / duration(nta_educ,EL3_HIGH),    //EN TGEI educ high

        weighted_duration(sex,FEMALE,sex_TGEI) / duration(sex,FEMALE),           //EN Agenta TGEI female
        weighted_duration(sex,MALE,sex_TGEI) / duration(sex,MALE),               //EN Agenta TGEI male
        weighted_duration(age_TGEI) / duration()                                 //EN Agenta TGEI by age
    }
    * integer_age
};

table Person TabNtaValidation_TGHI                                               //EN TGHI Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_TGHI) / duration(),                               //EN TGHI
        weighted_duration(sex,FEMALE, base_TGHI) / duration(sex,FEMALE),         //EN TGHI female
        weighted_duration(sex,MALE, base_TGHI) / duration(sex,MALE),             //EN TGHI male

        weighted_duration(nta_educ,EL3_LOW, base_TGHI) / duration(nta_educ,EL3_LOW),     //EN TGHI educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_TGHI) / duration(nta_educ,EL3_MEDIUM),  //EN TGHI educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_TGHI) / duration(nta_educ,EL3_HIGH),    //EN TGHI educ high

        weighted_duration(sex,FEMALE,sex_TGHI) / duration(sex,FEMALE),           //EN Agenta TGHI female
        weighted_duration(sex,MALE,sex_TGHI) / duration(sex,MALE),               //EN Agenta TGHI male
        weighted_duration(age_TGHI) / duration()                                 //EN Agenta TGHI by age
    }
    * integer_age
};

table Person TabNtaValidation_TGO                                               //EN TGO Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_TGO) / duration(),                               //EN TGO
        weighted_duration(sex,FEMALE, base_TGO) / duration(sex,FEMALE),         //EN TGO female
        weighted_duration(sex,MALE, base_TGO) / duration(sex,MALE),             //EN TGO male

        weighted_duration(nta_educ,EL3_LOW, base_TGO) / duration(nta_educ,EL3_LOW),     //EN TGO educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_TGO) / duration(nta_educ,EL3_MEDIUM),  //EN TGO educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_TGO) / duration(nta_educ,EL3_HIGH),    //EN TGO educ high

        weighted_duration(sex,FEMALE,sex_TGO) / duration(sex,FEMALE),           //EN Agenta TGO female
        weighted_duration(sex,MALE,sex_TGO) / duration(sex,MALE),               //EN Agenta TGO male
        weighted_duration(age_TGO) / duration()                                 //EN Agenta TGO by age
    }
    * integer_age
};

table Person TabNtaValidation_TFB                                               //EN TFB Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_TFB) / duration(),                               //EN TFB
        weighted_duration(sex,FEMALE, base_TFB) / duration(sex,FEMALE),         //EN TFB female
        weighted_duration(sex,MALE, base_TFB) / duration(sex,MALE),             //EN TFB male

        weighted_duration(nta_educ,EL3_LOW, base_TFB) / duration(nta_educ,EL3_LOW),     //EN TFB educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_TFB) / duration(nta_educ,EL3_MEDIUM),  //EN TFB educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_TFB) / duration(nta_educ,EL3_HIGH),    //EN TFB educ high

        weighted_duration(sex,FEMALE,sex_TFB) / duration(sex,FEMALE),           //EN Agenta TFB female
        weighted_duration(sex,MALE,sex_TFB) / duration(sex,MALE),               //EN Agenta TFB male
        weighted_duration(age_TFB) / duration()                                 //EN Agenta TFB by age
    }
    * integer_age
};

table Person TabNtaValidation_TFW                                               //EN TFW Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_TFW) / duration(),                               //EN TFW
        weighted_duration(sex,FEMALE, base_TFW) / duration(sex,FEMALE),         //EN TFW female
        weighted_duration(sex,MALE, base_TFW) / duration(sex,MALE),             //EN TFW male

        weighted_duration(nta_educ,EL3_LOW, base_TFW) / duration(nta_educ,EL3_LOW),     //EN TFW educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_TFW) / duration(nta_educ,EL3_MEDIUM),  //EN TFW educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_TFW) / duration(nta_educ,EL3_HIGH),    //EN TFW educ high

        weighted_duration(sex,FEMALE,sex_TFW) / duration(sex,FEMALE),           //EN Agenta TFW female
        weighted_duration(sex,MALE,sex_TFW) / duration(sex,MALE),               //EN Agenta TFW male
        weighted_duration(age_TFW) / duration()                                 //EN Agenta TFW by age
    }
    * integer_age
};

table Person TabNtaValidation_SF                                               //EN SF Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_SF) / duration(),                               //EN SF
        weighted_duration(sex,FEMALE, base_SF) / duration(sex,FEMALE),         //EN SF female
        weighted_duration(sex,MALE, base_SF) / duration(sex,MALE),             //EN SF male

        weighted_duration(nta_educ,EL3_LOW, base_SF) / duration(nta_educ,EL3_LOW),     //EN SF educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_SF) / duration(nta_educ,EL3_MEDIUM),  //EN SF educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_SF) / duration(nta_educ,EL3_HIGH),    //EN SF educ high

        weighted_duration(sex,FEMALE,sex_SF) / duration(sex,FEMALE),           //EN Agenta SF female
        weighted_duration(sex,MALE,sex_SF) / duration(sex,MALE),               //EN Agenta SF male
        weighted_duration(age_SF) / duration()                                 //EN Agenta SF by age
    }
    * integer_age
};

table Person TabNtaValidation_SG                                               //EN SG Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_SG) / duration(),                               //EN SG
        weighted_duration(sex,FEMALE, base_SG) / duration(sex,FEMALE),         //EN SG female
        weighted_duration(sex,MALE, base_SG) / duration(sex,MALE),             //EN SG male

        weighted_duration(nta_educ,EL3_LOW, base_SG) / duration(nta_educ,EL3_LOW),     //EN SG educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_SG) / duration(nta_educ,EL3_MEDIUM),  //EN SG educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_SG) / duration(nta_educ,EL3_HIGH),    //EN SG educ high

        weighted_duration(sex,FEMALE,sex_SG) / duration(sex,FEMALE),           //EN Agenta SG female
        weighted_duration(sex,MALE,sex_SG) / duration(sex,MALE),               //EN Agenta SG male
        weighted_duration(age_SG) / duration()                                 //EN Agenta SG by age
    }
    * integer_age
};

table Person TabNtaValidation_YL                                               //EN YL Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_YL) / duration(),                               //EN YL
        weighted_duration(sex,FEMALE, base_YL) / duration(sex,FEMALE),         //EN YL female
        weighted_duration(sex,MALE, base_YL) / duration(sex,MALE),             //EN YL male

        weighted_duration(nta_educ,EL3_LOW, base_YL) / duration(nta_educ,EL3_LOW),     //EN YL educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_YL) / duration(nta_educ,EL3_MEDIUM),  //EN YL educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_YL) / duration(nta_educ,EL3_HIGH),    //EN YL educ high

        weighted_duration(sex,FEMALE,sex_YL) / duration(sex,FEMALE),           //EN Agenta YL female
        weighted_duration(sex,MALE,sex_YL) / duration(sex,MALE),               //EN Agenta YL male
        weighted_duration(age_YL) / duration()                                 //EN Agenta YL by age
    }
    * integer_age
};

table Person TabNtaValidation_YAF                                               //EN YAF Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_YAF) / duration(),                               //EN YAF
        weighted_duration(sex,FEMALE, base_YAF) / duration(sex,FEMALE),         //EN YAF female
        weighted_duration(sex,MALE, base_YAF) / duration(sex,MALE),             //EN YAF male

        weighted_duration(nta_educ,EL3_LOW, base_YAF) / duration(nta_educ,EL3_LOW),     //EN YAF educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_YAF) / duration(nta_educ,EL3_MEDIUM),  //EN YAF educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_YAF) / duration(nta_educ,EL3_HIGH),    //EN YAF educ high

        weighted_duration(sex,FEMALE,sex_YAF) / duration(sex,FEMALE),           //EN Agenta YAF female
        weighted_duration(sex,MALE,sex_YAF) / duration(sex,MALE),               //EN Agenta YAF male
        weighted_duration(age_YAF) / duration()                                 //EN Agenta YAF by age
    }
    * integer_age
};

table Person TabNtaValidation_YAG                                               //EN YAG Validation
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    {
        weighted_duration(base_YAG) / duration(),                               //EN YAG
        weighted_duration(sex,FEMALE, base_YAG) / duration(sex,FEMALE),         //EN YAG female
        weighted_duration(sex,MALE, base_YAG) / duration(sex,MALE),             //EN YAG male

        weighted_duration(nta_educ,EL3_LOW, base_YAG) / duration(nta_educ,EL3_LOW),     //EN YAG educ low
        weighted_duration(nta_educ,EL3_MEDIUM, base_YAG) / duration(nta_educ,EL3_MEDIUM),  //EN YAG educ medium
        weighted_duration(nta_educ,EL3_HIGH, base_YAG) / duration(nta_educ,EL3_HIGH),    //EN YAG educ high

        weighted_duration(sex,FEMALE,sex_YAG) / duration(sex,FEMALE),           //EN Agenta YAG female
        weighted_duration(sex,MALE,sex_YAG) / duration(sex,MALE),               //EN Agenta YAG male
        weighted_duration(age_YAG) / duration()                                 //EN Agenta YAG by age
    }
    * integer_age
};


table Person TabNtaPopulation2010                           //EN NTA POPULATION
[calendar_year == MIN(SIM_YEAR_RANGE) && is_resident]
{
    nta_pop_group *
    tab_fam_index + *
    sex + *
    {
        duration() //EN Duration
    }
    * integer_age
    * nta_educ +
};