Step 22: Table Output

Overview

This step reorganizes and substantially extendes the model’s table output. Also It finalizes the model’s self-documentation. The result is the final model version used in the studies of the WELTRANSIM Work Package 2 report. It is also the model version available for download at the project website.

The TablesEducation.mpp Module

This module implements a set of tables related to education.




////////////////////////////////////////////////////////////////////////////////////////////////////
// Table Dimensions
////////////////////////////////////////////////////////////////////////////////////////////////////

partition AGE_530 { 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 }; //EN Age

classification YEAR10       //EN Year
{
    YEAR_2010,              //EN 2010
    YEAR_2020,              //EN 2020
    YEAR_2030,              //EN 2030
    YEAR_2040,              //EN 2040
    YEAR_2050,              //EN 2050
    YEAR_2060,              //EN 2060
    YEAR_2070,              //EN 2070
    YEAR_2080,              //EN 2080
    YEAR_2090,              //EN 2090
    YEAR_2100               //EN 2100
};

classification YEAR05       //EN Year
{
    YEAR5_2010,              //EN 2010
    YEAR5_2015,              //EN 2015
    YEAR5_2020,              //EN 2020
    YEAR5_2025,              //EN 2025
    YEAR5_2030,              //EN 2030
    YEAR5_2035,              //EN 2035
    YEAR5_2040,              //EN 2040
    YEAR5_2045,              //EN 2045
    YEAR5_2050,              //EN 2050
    YEAR5_2055,              //EN 2055
    YEAR5_2060,              //EN 2060
    YEAR5_2065,              //EN 2065
    YEAR5_2070,              //EN 2070
    YEAR5_2075,              //EN 2075
    YEAR5_2080,              //EN 2080
    YEAR5_2085,              //EN 2085
    YEAR5_2090,              //EN 2090
    YEAR5_2095,              //EN 2095
    YEAR5_2100               //EN 2100
};

partition AGE_5100  //EN Age Groups
{
    5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60,
    65, 70, 75, 80, 85, 90, 95, 100
};


////////////////////////////////////////////////////////////////////////////////////////////////////
// Table States
////////////////////////////////////////////////////////////////////////////////////////////////////

actor Person
{
    //EN Year
    YEAR10 year10 = (calendar_year == 2010) ? YEAR_2010 :
    (calendar_year == 2020) ? YEAR_2020 :
    (calendar_year == 2030) ? YEAR_2030 :
    (calendar_year == 2040) ? YEAR_2040 :
    (calendar_year == 2050) ? YEAR_2050 :
    (calendar_year == 2060) ? YEAR_2060 :
    (calendar_year == 2070) ? YEAR_2070 :
    (calendar_year == 2080) ? YEAR_2080 :
    (calendar_year == 2090) ? YEAR_2090 : YEAR_2100;

    //EN Year
    YEAR05 year05 = (calendar_year == 2010) ? YEAR5_2010 :
    (calendar_year == 2015) ? YEAR5_2015 :
    (calendar_year == 2020) ? YEAR5_2020 :
    (calendar_year == 2025) ? YEAR5_2025 :
    (calendar_year == 2030) ? YEAR5_2030 :
    (calendar_year == 2035) ? YEAR5_2035 :
    (calendar_year == 2040) ? YEAR5_2040 :
    (calendar_year == 2045) ? YEAR5_2045 :
    (calendar_year == 2050) ? YEAR5_2050 :
    (calendar_year == 2055) ? YEAR5_2055 :
    (calendar_year == 2060) ? YEAR5_2060 :
    (calendar_year == 2065) ? YEAR5_2065 :
    (calendar_year == 2070) ? YEAR5_2070 :
    (calendar_year == 2075) ? YEAR5_2075 :
    (calendar_year == 2080) ? YEAR5_2080 :
    (calendar_year == 2085) ? YEAR5_2085 :
    (calendar_year == 2090) ? YEAR5_2090 :
    (calendar_year == 2095) ? YEAR5_2095 : YEAR5_2100;

    logical is_year05 = (calendar_year == 2010 || calendar_year == 2020 || calendar_year == 2030 || calendar_year == 2040
        || calendar_year == 2050 || calendar_year == 2060 || calendar_year == 2070
        || calendar_year == 2080 || calendar_year == 2090 || calendar_year == 2100
        || calendar_year == 2015 || calendar_year == 2025 || calendar_year == 2035 || calendar_year == 2045
        || calendar_year == 2055 || calendar_year == 2065 || calendar_year == 2075
        || calendar_year == 2085 || calendar_year == 2095) ? TRUE : FALSE;


    logical is_year10 = (calendar_year == 2010 || calendar_year == 2020 || calendar_year == 2030 || calendar_year == 2040
        || calendar_year == 2050 || calendar_year == 2060 || calendar_year == 2070
        || calendar_year == 2080 || calendar_year == 2090 || calendar_year == 2100) ? TRUE : FALSE;

};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Table Groups
////////////////////////////////////////////////////////////////////////////////////////////////////

table_group TG_EDUCATION_TABLES                         //EN Education
{
    tabEducSchoolEnrolment,
    tabPopulationByEducation,
    tabPopulationByEducation2059,
    tabEducationYob,
    tabEducationParentsYob
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Tables
////////////////////////////////////////////////////////////////////////////////////////////////////

table Person tabEducSchoolEnrolment                     //EN School enrolment
[is_resident && in_projected_time]
{
    {
        duration(in_school, TRUE) / duration(),         //EN In any school decimals=2
        duration(in_regular_school, TRUE) / duration(), //EN In regular school decimals=2
        duration(in_other_education, TRUE) / duration() //EN In other school decimals=2
    }
    * split(integer_age, AGE_530)                       //EN Age
    * sim_year
};

table Person tabPopulationByEducation                   //EN Population by age group and education
[is_resident && is_year10]
{
    year10 *
    sex+ *
    {
        duration()
    }
    * split(integer_age, AGE_5100)+                     //EN Age
    * educ3_level+
};

table Person tabPopulationByEducation2059              //EN Population 20-59 by education
[is_resident && is_year05 && integer_age > 19 && integer_age < 60]
{
    sex+ *
    {
        duration()
    }
    * year05
    * educ3_level+
};


table Person tabEducationYob                //EN Education distribution at 30 by year of birth
[is_resident && integer_age == 30]
{
    sex+ *
    {
        duration()
    }
    * year_of_birth
    * educ_fate+
};

table Person tabEducationParentsYob          //EN Education of parents by year of birth
[is_resident && integer_age == 0]
{
    sex+ *
    {
        duration()
    }
    * year_of_birth
    * educ_parents+
};

The TablesFamily.mpp Module

This module implements a set of tables related to families



////////////////////////////////////////////////////////////////////////////////////////////////////
// Table Dimensions
////////////////////////////////////////////////////////////////////////////////////////////////////

partition   SHORT_TIME{ 0.01 };
partition   AGE_1025{ 10, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }; //EN Age

////////////////////////////////////////////////////////////////////////////////////////////////////
// Table States
////////////////////////////////////////////////////////////////////////////////////////////////////

actor Person
{
    //EN Single, no dependent children at home
    logical is_single_alone = (!has_partner && children_in_household == 0) ? TRUE : FALSE;

    //EN Single, dependent children at home
    logical is_single_child = (!has_partner && children_in_household > 0) ? TRUE : FALSE;

    //EN In partnership, no dependent children at home
    logical is_couple_alone = (has_partner && children_in_household == 0) ? TRUE : FALSE;

    //EN In partnership, dependent children at home
    logical is_couple_child = (has_partner && children_in_household > 0) ? TRUE : FALSE;

    //EN Person ever parent
    logical is_ever_parent = (entrances(lives_with_dependent_child,TRUE) > 0) ;

    //EN Lifetime spent single, no dependent children at home
    real time_is_single_alone = duration(is_single_alone, TRUE);

    //EN Lifetime spent single, with dependent children at home
    real time_is_single_child = duration(is_single_child, TRUE);

    //EN Lifetime spent in partnership, no dependent children at home
    real time_is_couple_alone = duration(is_couple_alone, TRUE);

    //EN Lifetime spent in partnership, with dependent children at home
    real time_is_couple_child = duration(is_couple_child, TRUE);
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Table Groups
////////////////////////////////////////////////////////////////////////////////////////////////////

table_group TG_FAMILY_TABLES    //EN Family
{
    tabFamilyType,
    tabCohortFamilyExperience20102014,
    tabLivingWithParents
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Tables
////////////////////////////////////////////////////////////////////////////////////////////////////

table Person tabFamilyType                              //EN Population by age and family type
[is_alive && is_resident && is_year10]
{
    year10 *
    sex + *
    educ_fate+ *
    split(integer_age, AGE5_PART) *
    {
        duration(is_single_alone,TRUE) / duration(),    //EN Single, no dependent children at home decimals=3
        duration(is_single_child,TRUE) / duration(),    //EN Single, dependent children at home decimals=3
        duration(is_couple_alone,TRUE) / duration(),    //EN In partnership, no dependent children at home decimals=3
        duration(is_couple_child,TRUE) / duration()     //EN In partnership, dependent children at home decimals=3
    }
};

table Person tabCohortFamilyExperience20102014          //EN Cohort 2010-2014 family experience
[is_resident && trigger_transitions(is_alive,TRUE,FALSE) && year_of_birth >= 2010 && year_of_birth < 2015 && person_type==PT_CHILD]
{
    sex + *
    is_ever_parent+ *
    educ_fate+ *
    {
        value_in(time_is_single_alone) / unit,          //EN Average time lived single, no dependent children at home decimals=3
        value_in(time_is_single_child) / unit,          //EN Average time lived single, dependent children at home decimals=3
        value_in(time_is_couple_alone) / unit,          //EN Average time lived in partnership, no dependent children at home decimals=3
        value_in(time_is_couple_child) / unit           //EN Average time lived in partnership, dependent children at home decimals=3
    }
};

table Person tabLivingWithParents                       //EN Living with parents
[is_resident && in_projected_time && is_year10]
{
    sex + *
    year10 *
    {
        duration(family_role,FR_CHILD) / duration()     //EN Living with parent(s) decimals=3
    }
    * split(integer_age, AGE_1025)
    * educ_fate +
};

The TablesFertility.mpp Module

This module implements a collection of tables related to fertility.



////////////////////////////////////////////////////////////////////////////////////////////////////
// Table Groups
////////////////////////////////////////////////////////////////////////////////////////////////////

table_group TG_FERTILITY_TABLES     //EN Fertility
{
    tabFertilityBirths,
    tabFertilityAgeBirth,
    tabFertilityCohortChildlessness,
    tabFertilityMaleCohortChildlesness,
    tabFertilityFemaleChildlessness
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Tables
////////////////////////////////////////////////////////////////////////////////////////////////////

table Person tabFertilityBirths //EN Births
[is_alive && in_projected_time && is_resident && sex==FEMALE && WITHIN(FERTILE_AGE_RANGE,integer_age)]
{
    {
        parity,                                                         //EN Births
        transitions(parity,0,1),                                        //EN First births
        parity/duration(),                                              //EN Birth rate decimals=4
        transitions(parity,0,1)/duration()                              //EN First birth rate decimals=4
    }
    * educ_fate+
    * fertile_age+
    * sim_year
};


table Person tabFertilityAgeBirth //EN Age at birth
[is_alive && in_projected_time && is_resident && sex==FEMALE && WITHIN(FERTILE_AGE_RANGE,integer_age)]
{
    {
        value_at_changes(parity,age) / changes(parity),                 //EN Average age birth decimals=2
        value_at_transitions(parity,0,1,age) / transitions(parity,0,1)  //EN Average age 1st birth decimals=2
    }
    * educ_fate+
    * sim_year
};

actor Person
{
    YOB_BIRTH1 yob1 = COERCE(YOB_BIRTH1,year_of_birth); //EN Year of birth
};

table Person tabFertilityCohortChildlessness                            //EN Cohort childlessness
[is_alive && integer_age==50 && is_resident && sex==FEMALE && WITHIN(YOB_BIRTH1,year_of_birth)]
{
    {
        duration(parity,0) / duration()                                 //EN Female cohort Childlessness decimals=2
    }
    * educ_fate+
    * yob1
};

table Person tabFertilityFemaleChildlessness                            //EN Female period childlessness
[is_alive && is_resident && sex==FEMALE && is_year10]
{
    year10 *
    {
        duration(parity,0) / duration()                                 //EN Cohort Childlessness decimals=2
    }
    * integer_age
    * educ_fate+
};


table Person tabFertilityMaleCohortChildlesness     //EN Male Cohort Childlessness (at death - run to 2150!)
[sex == MALE && is_resident && trigger_transitions(is_alive,TRUE,FALSE) && WITHIN(YOB_BIRTH1,year_of_birth)]
{
    {
        value_in(never_father) / unit               //EN Childlessenss decimals=2
    }
    * yob1
    * educ_fate +
};

The TablesMigration.mpp Module

This module implements table output related to international migration



////////////////////////////////////////////////////////////////////////////////////////////////////
// Table Groups
////////////////////////////////////////////////////////////////////////////////////////////////////

table_group TG_MIGRATION_TABLES  //EN Migration
{
    tabNumberMigrants
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Tables
////////////////////////////////////////////////////////////////////////////////////////////////////

table Person tabNumberMigrants                        //EN Number of migrants
[is_alive && in_projected_time]
{
    sex + *
    {
        //EN Immigrants
        transitions(ever_resident,FALSE,TRUE),

        //EN Emigrants
        transitions(is_resident,TRUE,FALSE),

        //EN Net migration
        transitions(ever_resident,FALSE,TRUE) - transitions(is_resident,TRUE,FALSE)
    }
    * integer_age+
    * sim_year
};

The TablesMortality.mpp Module

This module implements a collection of tables related to mortality.



////////////////////////////////////////////////////////////////////////////////////////////////////
// Table States
////////////////////////////////////////////////////////////////////////////////////////////////////

actor Person
{
    logical is_ever_60 = (entrances(integer_age,60) > 0); //EN Ever 60
    logical is_ever_65 = (entrances(integer_age,65) > 0); //EN Ever 65
    logical is_ever_70 = (entrances(integer_age,70) > 0); //EN Ever 70
    logical is_ever_75 = (entrances(integer_age,75) > 0); //EN Ever 75
    logical is_ever_80 = (entrances(integer_age,80) > 0); //EN Ever 80
    logical is_ever_85 = (entrances(integer_age,85) > 0); //EN Ever 85
    logical is_ever_90 = (entrances(integer_age,90) > 0); //EN Ever 90
    logical is_ever_95 = (entrances(integer_age,95) > 0); //EN Ever 95
    logical is_ever_100 = (entrances(integer_age,100) > 0); //EN Ever 100
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Table Groups
////////////////////////////////////////////////////////////////////////////////////////////////////


table_group TG_MORTALITY_TABLES //EN Mortality
{
    tabPeriodMortality,
    tabCohortLifeExpectancy20102014,
    tabMortalityNumberDeaths
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Tables
////////////////////////////////////////////////////////////////////////////////////////////////////

table Person tabCohortLifeExpectancy20102014    //EN Cohort 2010-2014 Life Expectancy
[is_resident && trigger_transitions(is_alive,TRUE,FALSE)
&& year_of_birth >= 2010 && year_of_birth < 2015 && person_type==PT_CHILD]
{
    sex + *
    educ_fate+ *
    {
        value_in(age) / unit,                       //EN Life expectancy decimals=3
        value_in(is_ever_60) / unit,                //EN Proportion surviving until 60 decimals=3
        value_in(is_ever_65) / unit,                //EN Proportion surviving until 65 decimals=3
        value_in(is_ever_70) / unit,                //EN Proportion surviving until 70 decimals=3
        value_in(is_ever_75) / unit,                //EN Proportion surviving until 75 decimals=3
        value_in(is_ever_80) / unit,                //EN Proportion surviving until 80 decimals=3
        value_in(is_ever_85) / unit,                //EN Proportion surviving until 85 decimals=3
        value_in(is_ever_90) / unit,                //EN Proportion surviving until 90 decimals=3
        value_in(is_ever_95) / unit,                //EN Proportion surviving until 95 decimals=3
        value_in(is_ever_100) / unit                //EN Proportion surviving until 100 decimals=3
    }
};

table Person tabPeriodMortality                     //EN Period mortality rates
[is_resident && in_projected_time && is_year10]
{
    sex + *
    year10 *
    {
        transitions(is_alive,TRUE,FALSE) / duration() //EN Mortality rate decimals=3
    }
    * integer_age
    * educ_fate+
};

table Person tabMortalityNumberDeaths                     //EN Number of deaths
[is_resident && in_projected_time]
{
    {
        transitions(is_alive,TRUE,FALSE)                //EN Deaths
    }
    * sim_year
};

The TablesNtaBasics.mpp Module

This module implements a set of output tables related to National Transfer Accounts (NTAs). Tables include national totlas for all NTA variables, average age profiles, and measures of the Life Course Deficit.



////////////////////////////////////////////////////////////////////////////////////////////////////
// Table Dimensions
////////////////////////////////////////////////////////////////////////////////////////////////////

partition AGE5105_PART                                         //EN Age Groups
{
    5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60,
    65, 70, 75, 80, 85, 90, 95, 100
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Table States
////////////////////////////////////////////////////////////////////////////////////////////////////

actor Person
{
    SIM_YEAR_RANGE sim_year = COERCE(SIM_YEAR_RANGE, calendar_year); //EN Year
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Groups
////////////////////////////////////////////////////////////////////////////////////////////////////

table_group TG_BasicNtaTabs //EN Basic NTA Tables
{
    TabBasicNta, TabBasicNtaByAge, tabLCDperCap, tabPopulationByAgeNta
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Tables
////////////////////////////////////////////////////////////////////////////////////////////////////

table Person TabBasicNta                        //EN Basic NTA totals
[WITHIN(SIM_YEAR_RANGE, calendar_year) && is_resident]
{
    {
        duration(),                             //EN Population
        weighted_duration(base_CFE),            //EN Private Consumption Education (CFE)
        weighted_duration(base_CFH),            //EN Private Consumption Health (CFH)
        weighted_duration(base_CFX),            //EN Private Consumption other than Education and Health (CFX)
        weighted_duration(base_CGE),            //EN Public Consumption Education (CGE)
        weighted_duration(base_CGH),            //EN Public Consumption Health (CGH)
        weighted_duration(base_CGX),            //EN Public Consumption other than Education and Health (CGX)
        weighted_duration(base_TGSOAI),         //EN Public Transfers Pensions, Inflows (TGSOAI)
        weighted_duration(base_TGXCI),          //EN Public Transfers Other Cash Inflows (TGXCI)
        weighted_duration(base_TGXII),          //EN Public Transfers Other In-Kind Inflows (TGXII)
        weighted_duration(base_TGEI),           //EN Public Transfers Education Inflows (TGEI)
        weighted_duration(base_TGHI),           //EN Public Transfers Health Inflows (TGHI)
        weighted_duration(base_TGO),            //EN Public Transfers Outflows (TGO)
        weighted_duration(base_TFB),            //EN Net Interhousehold Transfers (TFB)
        weighted_duration(base_TFW),            //EN Net Intrahousehold Transfers (TFW)
        weighted_duration(base_SF),             //EN Private Saving (SF)
        weighted_duration(base_SG),             //EN Public Saving (SG)
        weighted_duration(base_YL),             //EN Labor Income (LY)
        weighted_duration(base_YAF),            //EN Private Asset Income (YAF)
        weighted_duration(base_YAG)             //EN Public Asset Income (YAG)
    }
    * sim_year
};

table Person TabBasicNtaByAge                   //EN NTA by age
[WITHIN(SIM_YEAR_RANGE, calendar_year) && is_resident]
{
    sim_year*
    {
        duration(),                                          //EN Population
        weighted_duration(base_CFE) / duration(),            //EN Private Consumption Education (CFE)
        weighted_duration(base_CFH) / duration(),            //EN Private Consumption Health (CFH)
        weighted_duration(base_CFX) / duration(),            //EN Private Consumption other than Education and Health (CFX)
        weighted_duration(base_CGE) / duration(),            //EN Public Consumption Education (CGE)
        weighted_duration(base_CGH) / duration(),            //EN Public Consumption Health (CGH)
        weighted_duration(base_CGX) / duration(),            //EN Public Consumption other than Education and Health (CGX)
        weighted_duration(base_TGSOAI) / duration(),         //EN Public Transfers Pensions, Inflows (TGSOAI)
        weighted_duration(base_TGXCI) / duration(),          //EN Public Transfers Other Cash Inflows (TGXCI)
        weighted_duration(base_TGXII) / duration(),          //EN Public Transfers Other In-Kind Inflows (TGXII)
        weighted_duration(base_TGEI) / duration(),           //EN Public Transfers Education Inflows (TGEI)
        weighted_duration(base_TGHI) / duration(),           //EN Public Transfers Health Inflows (TGHI)
        weighted_duration(base_TGO) / duration(),            //EN Public Transfers Outflows (TGO)
        weighted_duration(base_TFB) / duration(),            //EN Net Interhousehold Transfers (TFB)
        weighted_duration(base_TFW) / duration(),            //EN Net Intrahousehold Transfers (TFW)
        weighted_duration(base_SF) / duration(),             //EN Private Saving (SF)
        weighted_duration(base_SG) / duration(),             //EN Public Saving (SG)
        weighted_duration(base_YL) / duration(),             //EN Labor Income (LY)
        weighted_duration(base_YAF) / duration(),            //EN Private Asset Income (YAF)
        weighted_duration(base_YAG) / duration()             //EN Public Asset Income (YAG)
    }
    * integer_age
};

table Person tabLCDperCap                                    //EN Life Course Deficit
[WITHIN(SIM_YEAR_RANGE, calendar_year) && is_resident]
{
    {
        (weighted_duration(base_CFE) + weighted_duration(base_CFH) + weighted_duration(base_CFX) + weighted_duration(base_CGE) + weighted_duration(base_CGH) + weighted_duration(base_CGX)) / duration(), //EN average consumption
        weighted_duration(base_YL) / duration(),             //EN Average labor Income (LY)
        -(weighted_duration(base_CFE) + weighted_duration(base_CFH) + weighted_duration(base_CFX) + weighted_duration(base_CGE) + weighted_duration(base_CGH) + weighted_duration(base_CGX) - weighted_duration(base_YL)) / duration() //EN Average gap
    }
* sim_year
};

table Person tabPopulationByAgeNta                   //EN Population by age group and NTA type
[is_resident && is_year10]
{
    year10 *
    tab_fam_index *
    sex *
    {
        duration()
    }
    * nta_pop_group                     //EN Population Group
    * nta_educ+
};

The TablesNtaGenAccounts.mpp Module

This module implements table output related to Full General Accounts (FGAs).



////////////////////////////////////////////////////////////////////////////////////////////////////
// Table Groups
////////////////////////////////////////////////////////////////////////////////////////////////////

table_group TG_FullGenerationalAccounts             //EN NTA Full Generational Accounts
{
    tabFgaUnadjustedTotals,
    tabFgaPV,
    tabFgaPVDetail,
    tabAdjustmentFga,
    tabFgaPV_2010CW,
    tabFgaPV_2040CW,
    tabFgaPV_2010CWdetail,
    tabFgaPV_2040CWdetail
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Tables
////////////////////////////////////////////////////////////////////////////////////////////////////

table Person tabFgaUnadjustedTotals                 //EN FGA Totals
[is_resident && in_projected_time]
{
    {
        weighted_duration(fga_YL),                  //EN YL total
        weighted_duration(fga_TF),                  //EN TF total
        weighted_duration(fga_TGI),                 //EN TGI total
        weighted_duration(fga_TGO),                 //EN TGO total
        weighted_duration(fga_TF_adj),              //EN TF total adjusted
        weighted_duration(fga_TGI_adj),             //EN TGI total adjusted
        weighted_duration(fga_TGO_adj)              //EN TGO total adjusted
    }
    * sim_year
};

table Person tabFgaPV                               //EN FGA PV
[is_resident && person_type == PT_CHILD
&& trigger_transitions(is_alive,TRUE,FALSE)]
{
    educ_fate+ *
    {
        value_in(fga_YL_pv) / unit,                 //EN Present Value YL at birth
        value_in(fga_TF_pv) / unit,                 //EN Present Value TF at birth
        value_in(fga_TGI_pv) / unit,                //EN Present Value TGI at birth
        value_in(fga_TGO_pv) / unit,                //EN Present Value TGO at birth
        value_in(fga_TF_adj_pv) / unit,             //EN Present Value TF adjusted at birth
        value_in(fga_TGI_adj_pv) / unit,            //EN Present Value TGI adjsuted at birth
        value_in(fga_TGO_adj_pv) / unit             //EN Present Value TGO adjusted at birth
    }
    * year_of_birth
};

table Person tabFgaPVDetail                         //EN FGA PV by detailed Group
[is_resident && person_type == PT_CHILD && yob_in_2010_2100
&& trigger_transitions(is_alive,TRUE,FALSE)]
{
    educ_fate+ *
    sex+ *
    ever_parent+ *
    {
        value_in(fga_YL_pv) / unit,                 //EN Present Value YL at birth
        value_in(fga_TF_pv) / unit,                 //EN Present Value TF at birth
        value_in(fga_TGI_pv) / unit,                //EN Present Value TGI at birth
        value_in(fga_TGO_pv) / unit,                //EN Present Value TGO at birth
        value_in(fga_TF_adj_pv) / unit,             //EN Present Value TF adjusted at birth
        value_in(fga_TGI_adj_pv) / unit,            //EN Present Value TGI adjsuted at birth
        value_in(fga_TGO_adj_pv) / unit,            //EN Present Value TGO adjusted at birth
        unit                                        //EN Persons
    }
    * yob_2010_2100
};


table Globals tabAdjustmentFga                      //EN FGA Adjustment factors
[globals_in_projected_time]
{
    {
        max_value_in(adj_factor_TFI),               //EN Adjustment TFI decimals=3
        max_value_in(adj_factor_TFO),               //EN Adjustment TFO decimals=3
        max_value_in(adj_factor_TGI),               //EN Adjustment TGI decimals=3
        max_value_in(adj_factor_TGO)                //EN Adjustment TGO decimals=3
    }
    * global_tab_sim_year
};

table Person tabFgaPV_2010CW                          //EN FGA PV 2010
[is_resident && person_type != PT_IMMIGRANT
&& trigger_transitions(is_alive,TRUE,FALSE)
&& year_of_birth <= 2010]
{
    educ_fate+ *
    {
        value_in(fga_YL_pv_2010) / value_in(cohort_weight),            //EN Present Value YL 2010
        value_in(fga_TF_pv_2010) / value_in(cohort_weight),            //EN Present Value TF 2010
        value_in(fga_TGI_pv_2010) / value_in(cohort_weight),           //EN Present Value TGI 2010
        value_in(fga_TGO_pv_2010) / value_in(cohort_weight),           //EN Present Value TGO 2010
        value_in(fga_TF_adj_pv_2010) / value_in(cohort_weight),        //EN Present Value TF adjusted 2010
        value_in(fga_TGI_adj_pv_2010) / value_in(cohort_weight),       //EN Present Value TGI adjusted 2010
        value_in(fga_TGO_adj_pv_2010) / value_in(cohort_weight)        //EN Present Value TGO adjusted 2010
    }
    * age_2010
};

table Person tabFgaPV_2040CW                        //EN FGA PV 2040
[is_resident && person_type != PT_IMMIGRANT
&& trigger_transitions(is_alive,TRUE,FALSE)
&& year_of_birth <= 2040]
{
    educ_fate+ *
    {
        value_in(fga_YL_pv_2040) / value_in(cohort_weight),            //EN Present Value YL 2040
        value_in(fga_TF_pv_2040) / value_in(cohort_weight),            //EN Present Value TF 2040
        value_in(fga_TGI_pv_2040) / value_in(cohort_weight),           //EN Present Value TGI 2040
        value_in(fga_TGO_pv_2040) / value_in(cohort_weight),           //EN Present Value TGO 2040
        value_in(fga_TF_adj_pv_2040) / value_in(cohort_weight),        //EN Present Value TF adjusted 2040
        value_in(fga_TGI_adj_pv_2040) / value_in(cohort_weight),       //EN Present Value TGI adjusted 2040
        value_in(fga_TGO_adj_pv_2040) / value_in(cohort_weight)        //EN Present Value TGO adjusted 2040
    }
    * age_2040
};

table Person tabFgaPV_2010CWdetail                          //EN FGA PV 2010 - detailed
[is_resident && person_type != PT_IMMIGRANT
&& trigger_transitions(is_alive,TRUE,FALSE)
&& year_of_birth <= 2010]
{
    educ_fate+ *
    sex+ *
    ever_parent+ *
    {
        value_in(fga_YL_pv_2010) / value_in(cohort_weight),            //EN Present Value YL 2010
        value_in(fga_TF_pv_2010) / value_in(cohort_weight),            //EN Present Value TF 2010
        value_in(fga_TGI_pv_2010) / value_in(cohort_weight),           //EN Present Value TGI 2010
        value_in(fga_TGO_pv_2010) / value_in(cohort_weight),           //EN Present Value TGO 2010
        value_in(fga_TF_adj_pv_2010) / value_in(cohort_weight),        //EN Present Value TF adjusted 2010
        value_in(fga_TGI_adj_pv_2010) / value_in(cohort_weight),       //EN Present Value TGI adjusted 2010
        value_in(fga_TGO_adj_pv_2010) / value_in(cohort_weight)        //EN Present Value TGO adjusted 2010
    }
    * age_2010
};

table Person tabFgaPV_2040CWdetail                        //EN FGA PV 2040 - detailed
[is_resident && person_type != PT_IMMIGRANT
&& trigger_transitions(is_alive,TRUE,FALSE)
&& year_of_birth <= 2040]
{
    educ_fate+ *
    sex+ *
    ever_parent+ *
    {
        value_in(fga_YL_pv_2040) / value_in(cohort_weight),            //EN Present Value YL 2040
        value_in(fga_TF_pv_2040) / value_in(cohort_weight),            //EN Present Value TF 2040
        value_in(fga_TGI_pv_2040) / value_in(cohort_weight),           //EN Present Value TGI 2040
        value_in(fga_TGO_pv_2040) / value_in(cohort_weight),           //EN Present Value TGO 2040
        value_in(fga_TF_adj_pv_2040) / value_in(cohort_weight),        //EN Present Value TF adjusted 2040
        value_in(fga_TGI_adj_pv_2040) / value_in(cohort_weight),       //EN Present Value TGI adjusted 2040
        value_in(fga_TGO_adj_pv_2040) / value_in(cohort_weight)        //EN Present Value TGO adjusted 2040
    }
    * age_2040
};

The TablesNtaIndicators.mpp Module

This modules produces output tables related to NTA indicators, including the Support Ration, the Imapct Index, and aggregate measures of effective labour, consumers, income, capital, as well as wages in dthe interest rate in a closed economy.



////////////////////////////////////////////////////////////////////////////////////////////////////
// Groups
////////////////////////////////////////////////////////////////////////////////////////////////////

table_group TG_NTAIndicators                    //EN NTA Indicators and Impact Index Lee 2017
{
    TabNTAIndicators
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Tables
////////////////////////////////////////////////////////////////////////////////////////////////////

table State TabNTAIndicators                    //EN NTA Indicators and Impact Index Lee 2017
[WITHIN(SIM_YEAR_RANGE,state_year) && nta_is_updated]
{
    {
        max_value_in(nta_current_SR),           //EN Support Ratio SR decimals=4
        max_value_in(nta_current_closed_IMP),   //EN Impact Index IMP closed economy decimals=4
        max_value_in(nta_current_open_IMP),     //EN Impact Index IMP open economy decimals=4
        max_value_in(nta_current_N),            //EN Current reference consumers N
        max_value_in(nta_current_L),            //EN Current total Labor L
        max_value_in(nta_current_C),            //EN Current total Consumption
        max_value_in(nta_current_Y),            //EN Current total Income Y
        max_value_in(nta_current_K),            //EN Current total Capital K
        max_value_in(nta_current_w),            //EN Current wage w closed economy decimals=4
        max_value_in(nta_current_r)             //EN Current interest rate r closed economy decimals=4
    }
    * tab_state_year
};

The TablesNtaValidation.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.



////////////////////////////////////////////////////////////////////////////////////////////////////
// Dimensions
////////////////////////////////////////////////////////////////////////////////////////////////////

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,NE_LOW, base_CFE) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_CFE) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_CFE) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_CFE) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_CFH) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_CFH) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_CFH) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_CFH) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_CFX) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_CFX) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_CFX) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_CFX) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_CGE) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_CGE) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_CGE) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_CGE) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_CGH) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_CGH) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_CGH) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_CGH) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_CGX) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_CGX) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_CGX) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_CGX) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_TGSOAI) / duration(nta_educ,NE_LOW),        //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_TGSOAI) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_TGSOAI) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_TGSOAI) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_TGXCI) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_TGXCI) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_TGXCI) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_TGXCI) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_TGXII) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_TGXII) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_TGXII) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_TGXII) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_TGEI) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_TGEI) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_TGEI) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_TGEI) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_TGHI) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_TGHI) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_TGHI) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_TGHI) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_TGO) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_TGO) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_TGO) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_TGO) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_TFB) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_TFB) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_TFB) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_TFB) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_TFW) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_TFW) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_TFW) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_TFW) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_SF) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_SF) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_SF) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_SF) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_SG) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_SG) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_SG) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_SG) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_YL) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_YL) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_YL) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_YL) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_YAF) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_YAF) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_YAF) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_YAF) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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,NE_LOW, base_YAG) / duration(nta_educ,NE_LOW),     //EN CFE educ low
        weighted_duration(nta_educ,NE_MEDIUM, base_YAG) / duration(nta_educ,NE_MEDIUM),  //EN CFE educ medium
        weighted_duration(nta_educ,NE_HIGH, base_YAG) / duration(nta_educ,NE_HIGH),    //EN CFE educ high
        weighted_duration(nta_educ,NE_NN, base_YAG) / duration(nta_educ,NE_NN),    //EN CFE educ nn

        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 +
};

The TablesNtaVisualisation.mpp Module

This module implements table output as base of the online NTA visualisation tool. The module is optional and can be removed from the application. Table output is produced for two points in time - the starting year and the calendar year 50 years later. Currently, the output for the future is a dummy output only.



////////////////////////////////////////////////////////////////////////////////////////////////////
// Dimensions
////////////////////////////////////////////////////////////////////////////////////////////////////


classification NTA_VISULAL_YEAR         //EN Year
{
    NVY_BASE,                           //EN Base year
    NVY_BASEP50                         //EN Projected year
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// States used in the table output
////////////////////////////////////////////////////////////////////////////////////////////////////

actor Person
{
    double current_CFE =  (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_CFE : base_CFE * 1.5;         //EN Private Consumption Education (CFE)
    double current_CFH =  (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_CFH : base_CFH * 1.5;         //EN Private Consumption Health (CFH)
    double current_CFX = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_CFX : base_CFX * 1.5;         //EN Private Consumption other than Education and Health (CFX)
    double current_CGE =  (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_CGE : base_CGE * 1.5;         //EN Public Consumption Education (CGE)
    double current_CGH = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_CGH : base_CGH * 1.5;         //EN Public Consumption Health (CGH)
    double current_CGX = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_CGX : base_CGX * 1.5;         //EN Public Consumption other than Education and Health (CGX)
    double current_TGSOAI = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_TGSOAI : base_TGSOAI * 1.5;   //EN Public Transfers Pensions, Inflows (TGSOAI)
    double current_TGXCI = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_TGXCI : base_TGXCI * 1.5;     //EN Public Transfers Other Cash Inflows (TGXCI)
    double current_TGXII = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_TGXII : base_TGXII * 1.5;     //EN Public Transfers Other In-Kind Inflows (TGXII)
    double current_TGEI = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_TGEI : base_TGEI * 1.5;       //EN Public Transfers Education Inflows (TGEI)
    double current_TGHI = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_TGHI : base_TGHI * 1.5;       //EN Public Transfers Health Inflows (TGHI)
    double current_TGO = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_TGO : base_TGO * 1.5;         //EN Public Transfers Outflows (TGO)
    double current_TFB = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_TFB : base_TFB * 1.5;   //EN Net Interhousehold Transfers (TFB)
    double current_TFW = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_TFW : base_TFW * 1.5;//EN Net Intrahousehold Transfers (TFW)
    double current_SF = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_SF : base_SF * 1.5;           //EN Private Saving (SF)
    double current_SG = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_SG : base_SG * 1.5;           //EN Public Saving (SG)
    double current_YL = (calendar_year == MIN(SIM_YEAR_RANGE)) ? base_YL : base_YL * 1.5;           //EN Labor Income (LY)
    double current_YAF = (calendar_year == MIN(SIM_YEAR_RANGE)) ?  base_YAF : base_YAF * 1.5;         //EN Private Asset Income (YAF)
    double current_YAG = (calendar_year == MIN(SIM_YEAR_RANGE)) ?  base_YAG : base_YAG * 1.5;         //EN Public Asset Income (YAG)

    logical in_nta_visualisation_year = (calendar_year == MIN(SIM_YEAR_RANGE) || calendar_year == MIN(SIM_YEAR_RANGE) + 50);
    NTA_VISULAL_YEAR nta_visual_year = (calendar_year == MIN(SIM_YEAR_RANGE)) ? NVY_BASE : NVY_BASEP50;     //EN Year
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Table Groups
////////////////////////////////////////////////////////////////////////////////////////////////////


table_group TG_NTA_VISAL //EN NTA Visualisations
{
    tabNtaVisualisationChild,
    tabNtaVisualisationStudent,
    tabNtaVisualisationYoung,
    tabNtaVisualisationAdults,
    tabNtaVisualisationOld
};


////////////////////////////////////////////////////////////////////////////////////////////////////
// Tables
////////////////////////////////////////////////////////////////////////////////////////////////////

table Person tabNtaVisualisationChild       //EN NTA Visualisation Children
[ in_nta_visualisation_year && nta_pop_group == NPG_CHILD && is_resident]
{
    nta_visual_year*
    {
        duration(), //EN Population
        weighted_duration(current_CFE) / duration(),    //EN Private Consumption Education (CFE)
        weighted_duration(current_CFH) / duration(),    //EN Private Consumption Health (CFH)
        weighted_duration(current_CFX) / duration(),    //EN Private Consumption other than Education and Health (CFX)
        weighted_duration(current_CGE) / duration(),    //EN Public Consumption Education (CGE)
        weighted_duration(current_CGH) / duration(),    //EN Public Consumption Health (CGH)
        weighted_duration(current_CGX) / duration(),    //EN Public Consumption other than Education and Health (CGX)
        weighted_duration(current_TGSOAI) / duration(), //EN Public Transfers Pensions, Inflows (TGSOAI)
        weighted_duration(current_TGXCI) / duration(),  //EN Public Transfers Other Cash Inflows (TGXCI)
        weighted_duration(current_TGXII) / duration(),  //EN Public Transfers Other In-Kind Inflows (TGXII)
        weighted_duration(current_TGEI) / duration(),   //EN Public Transfers Education Inflows (TGEI)
        weighted_duration(current_TGHI) / duration(),   //EN Public Transfers Health Inflows (TGHI)
        weighted_duration(current_TGO) / duration(),    //EN Public Transfers Outflows (TGO)
        weighted_duration(current_TFB) / duration(),    //EN Net Interhousehold Transfers (TFB)
        weighted_duration(current_TFW) / duration(),    //EN Net Intrahousehold Transfers (TFW)
        weighted_duration(current_SF) / duration(),     //EN Private Saving (SF)
        weighted_duration(current_SG) / duration(),     //EN Public Saving (SG)
        weighted_duration(current_YL) / duration(),     //EN Labor Income (LY)
        weighted_duration(current_YAF) / duration(),    //EN Private Asset Income (YAF)
        weighted_duration(current_YAG) / duration()     //EN Public Asset Income (YAG)
    }
    *educ_parents +
};


table Person tabNtaVisualisationStudent       //EN NTA Visualisation Young Students
[ in_nta_visualisation_year && nta_pop_group == NPG_YOUNG_STUDENT  && is_resident]
{
    nta_visual_year*
    {
        duration(),                                     //EN Population
        duration(sex,FEMALE) / duration(),              //EN Proportion Female
        weighted_duration(current_CFE) / duration(),    //EN Private Consumption Education (CFE)
        weighted_duration(current_CFH) / duration(),    //EN Private Consumption Health (CFH)
        weighted_duration(current_CFX) / duration(),    //EN Private Consumption other than Education and Health (CFX)
        weighted_duration(current_CGE) / duration(),    //EN Public Consumption Education (CGE)
        weighted_duration(current_CGH) / duration(),    //EN Public Consumption Health (CGH)
        weighted_duration(current_CGX) / duration(),    //EN Public Consumption other than Education and Health (CGX)
        weighted_duration(current_TGSOAI) / duration(), //EN Public Transfers Pensions, Inflows (TGSOAI)
        weighted_duration(current_TGXCI) / duration(),  //EN Public Transfers Other Cash Inflows (TGXCI)
        weighted_duration(current_TGXII) / duration(),  //EN Public Transfers Other In-Kind Inflows (TGXII)
        weighted_duration(current_TGEI) / duration(),   //EN Public Transfers Education Inflows (TGEI)
        weighted_duration(current_TGHI) / duration(),   //EN Public Transfers Health Inflows (TGHI)
        weighted_duration(current_TGO) / duration(),    //EN Public Transfers Outflows (TGO)
        weighted_duration(current_TFB) / duration(),    //EN Net Interhousehold Transfers (TFB)
        weighted_duration(current_TFW) / duration(),    //EN Net Intrahousehold Transfers (TFW)
        weighted_duration(current_SF) / duration(),     //EN Private Saving (SF)
        weighted_duration(current_SG) / duration(),     //EN Public Saving (SG)
        weighted_duration(current_YL) / duration(),     //EN Labor Income (LY)
        weighted_duration(current_YAF) / duration(),    //EN Private Asset Income (YAF)
        weighted_duration(current_YAG) / duration()     //EN Public Asset Income (YAG)
    }
    * nta_educ +
};

table Person tabNtaVisualisationYoung       //EN NTA Visualisation Young Workers
[ in_nta_visualisation_year && nta_pop_group == NPG_YOUNG_WORK  && is_resident]
{
    nta_visual_year*
    sex+ *
    nta_family_active+ *
    {
        duration(), //EN Population
        weighted_duration(current_CFE) / duration(),    //EN Private Consumption Education (CFE)
        weighted_duration(current_CFH) / duration(),    //EN Private Consumption Health (CFH)
        weighted_duration(current_CFX) / duration(),    //EN Private Consumption other than Education and Health (CFX)
        weighted_duration(current_CGE) / duration(),    //EN Public Consumption Education (CGE)
        weighted_duration(current_CGH) / duration(),    //EN Public Consumption Health (CGH)
        weighted_duration(current_CGX) / duration(),    //EN Public Consumption other than Education and Health (CGX)
        weighted_duration(current_TGSOAI) / duration(), //EN Public Transfers Pensions, Inflows (TGSOAI)
        weighted_duration(current_TGXCI) / duration(),  //EN Public Transfers Other Cash Inflows (TGXCI)
        weighted_duration(current_TGXII) / duration(),  //EN Public Transfers Other In-Kind Inflows (TGXII)
        weighted_duration(current_TGEI) / duration(),   //EN Public Transfers Education Inflows (TGEI)
        weighted_duration(current_TGHI) / duration(),   //EN Public Transfers Health Inflows (TGHI)
        weighted_duration(current_TGO) / duration(),    //EN Public Transfers Outflows (TGO)
        weighted_duration(current_TFB) / duration(),    //EN Net Interhousehold Transfers (TFB)
        weighted_duration(current_TFW) / duration(),    //EN Net Intrahousehold Transfers (TFW)
        weighted_duration(current_SF) / duration(),     //EN Private Saving (SF)
        weighted_duration(current_SG) / duration(),     //EN Public Saving (SG)
        weighted_duration(current_YL) / duration(),     //EN Labor Income (LY)
        weighted_duration(current_YAF) / duration(),    //EN Private Asset Income (YAF)
        weighted_duration(current_YAG) / duration()     //EN Public Asset Income (YAG)
    }
    * educ_fate +
};

table Person tabNtaVisualisationAdults       //EN NTA Visualisation Adult Workers
[ in_nta_visualisation_year && nta_pop_group == NPG_ADULT_WORK  && is_resident]
{
    nta_visual_year*
    sex+ *
    nta_family_active+ *
    {
        duration(), //EN Population
        weighted_duration(current_CFE) / duration(),    //EN Private Consumption Education (CFE)
        weighted_duration(current_CFH) / duration(),    //EN Private Consumption Health (CFH)
        weighted_duration(current_CFX) / duration(),    //EN Private Consumption other than Education and Health (CFX)
        weighted_duration(current_CGE) / duration(),    //EN Public Consumption Education (CGE)
        weighted_duration(current_CGH) / duration(),    //EN Public Consumption Health (CGH)
        weighted_duration(current_CGX) / duration(),    //EN Public Consumption other than Education and Health (CGX)
        weighted_duration(current_TGSOAI) / duration(), //EN Public Transfers Pensions, Inflows (TGSOAI)
        weighted_duration(current_TGXCI) / duration(),  //EN Public Transfers Other Cash Inflows (TGXCI)
        weighted_duration(current_TGXII) / duration(),  //EN Public Transfers Other In-Kind Inflows (TGXII)
        weighted_duration(current_TGEI) / duration(),   //EN Public Transfers Education Inflows (TGEI)
        weighted_duration(current_TGHI) / duration(),   //EN Public Transfers Health Inflows (TGHI)
        weighted_duration(current_TGO) / duration(),    //EN Public Transfers Outflows (TGO)
        weighted_duration(current_TFB) / duration(),    //EN Net Interhousehold Transfers (TFB)
        weighted_duration(current_TFW) / duration(),    //EN Net Intrahousehold Transfers (TFW)
        weighted_duration(current_SF) / duration(),     //EN Private Saving (SF)
        weighted_duration(current_SG) / duration(),     //EN Public Saving (SG)
        weighted_duration(current_YL) / duration(),     //EN Labor Income (LY)
        weighted_duration(current_YAF) / duration(),    //EN Private Asset Income (YAF)
        weighted_duration(current_YAG) / duration()     //EN Public Asset Income (YAG)
    }
    * educ_fate +
};


table Person tabNtaVisualisationOld       //EN NTA Visualisation Old
[ in_nta_visualisation_year && nta_pop_group == NPG_OLD  && is_resident]
{
    nta_visual_year*
    sex+ *
    nta_family_old+ *
    {
        duration(), //EN Population
        weighted_duration(current_CFE) / duration(),    //EN Private Consumption Education (CFE)
        weighted_duration(current_CFH) / duration(),    //EN Private Consumption Health (CFH)
        weighted_duration(current_CFX) / duration(),    //EN Private Consumption other than Education and Health (CFX)
        weighted_duration(current_CGE) / duration(),    //EN Public Consumption Education (CGE)
        weighted_duration(current_CGH) / duration(),    //EN Public Consumption Health (CGH)
        weighted_duration(current_CGX) / duration(),    //EN Public Consumption other than Education and Health (CGX)
        weighted_duration(current_TGSOAI) / duration(), //EN Public Transfers Pensions, Inflows (TGSOAI)
        weighted_duration(current_TGXCI) / duration(),  //EN Public Transfers Other Cash Inflows (TGXCI)
        weighted_duration(current_TGXII) / duration(),  //EN Public Transfers Other In-Kind Inflows (TGXII)
        weighted_duration(current_TGEI) / duration(),   //EN Public Transfers Education Inflows (TGEI)
        weighted_duration(current_TGHI) / duration(),   //EN Public Transfers Health Inflows (TGHI)
        weighted_duration(current_TGO) / duration(),    //EN Public Transfers Outflows (TGO)
        weighted_duration(current_TFB) / duration(),    //EN Net Interhousehold Transfers (TFB)
        weighted_duration(current_TFW) / duration(),    //EN Net Intrahousehold Transfers (TFW)
        weighted_duration(current_SF) / duration(),     //EN Private Saving (SF)
        weighted_duration(current_SG) / duration(),     //EN Public Saving (SG)
        weighted_duration(current_YL) / duration(),     //EN Labor Income (LY)
        weighted_duration(current_YAF) / duration(),    //EN Private Asset Income (YAF)
        weighted_duration(current_YAG) / duration()     //EN Public Asset Income (YAG)
    }
    * educ_fate +
};

The TablesPopulation.mpp Module

This module implements table output related to the total population and its composition



////////////////////////////////////////////////////////////////////////////////////////////////////
// Table Groups
////////////////////////////////////////////////////////////////////////////////////////////////////

table_group TG_POPULATION_TABLES            //EN Population
{
    tabTotalPopulationAgeSexEduc
};

////////////////////////////////////////////////////////////////////////////////////////////////////
// Tables
////////////////////////////////////////////////////////////////////////////////////////////////////

table Person tabTotalPopulationAgeSexEduc   //EN Population by age, sex and education
[is_resident && is_alive && in_projected_time]
{
    sex + *
    educ3_level+ *
    {
        duration()                          //EN Population
    }
    * integer_age
    * sim_year
};