Step 17: Basic NTA

Overview

At this step we add a new module for NTA variables by sex, education and family type. According to the current life-course situation, a list of NTA variables with the base year’s NTA values is maintained. In order to allow comparing published with disagrregated NTA variables within a single simulation - and to add user choices concerning the disaggregation level of NTA data used in a simulation - we include paramers for published NTA variables and model selection. Users can choose to use (1) NTA by age, (2) NTA by age and sex, or (3) NTA by age, sex, family type and education.

The new NtaBase.mpp Module

This module implements the base NTA parameters and variables by sex, education and family type. For children and students, education refers to parent’s education, for all others the own educational attainment. By age and school enrolment we distinguish 6 person types:

  • Children 0-16

  • Students 17-25

  • Non-students 17-25

  • Adults 26-59

  • Adults 60+

For the non-student population 17-25 and adults 26-59, we distinguish 6 family types:

  • Single not living with children age <25

  • Single living with young child(ren) age < 3

  • Single living with older child(ren) < 25

  • Couple not living with children age <25

  • Couple living with young child(ren) age < 3

  • Couple living with older child(ren) < 25

For the population 60+ we distinguis 4 family types:

  • Single childless

  • Single ever parent

  • Couple childless

  • Couple ever parent

The module maintains the individual base NTA variables depending on the current individual characteristics from the according parameters. The list of variables is:

  • Private Consumption Education (CFE)

  • Private Consumption Health (CFH)

  • Private Consumption other than Education and Health (CFX)

  • Public Consumption Education (CGE)

  • Public Consumption Health (CGH)

  • Public Consumption other than Education and Health (CGX)

  • Public Transfers Pensions, Inflows (TGSOAI)

  • Public Transfers Other Cash Inflows (TGXCI)

  • Public Transfers Other In-Kind Inflows (TGXII)

  • Public Transfers Education Inflows (TGEI)

  • Public Transfers Health Inflows (TGHI)

  • Public Transfers Outflows (TGO)

  • Net Interhousehold Transfers (TFB)

  • Net Intrahousehold Transfers (TFW)

  • Private Saving (SF)

  • Public Saving (SG)

  • Labor Income (LY)

  • Private Asset Income (YAF)

  • Public Asset Income (YAG)

The module also contains parameters for published NTA data (by age only, and by age and sex) allowing for comparing simulation results. Users can choose which NTA data to use in the simulation.



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

classification NTA_POP_GROUP        //EN NTA Population Group
{
    NPG_CHILD,                      //EN Child 0-16
    NPG_YOUNG_STUDENT,              //EN Student 17-25
    NPG_YOUNG_WORK,                 //EN Non-student 17-25
    NPG_ADULT_WORK,                 //EN Adult 26-59
    NPG_OLD                         //EN Adult 60+
};

classification NTA_FAMILY_ACTIVE    //EN Family type of non-students 17+ and adults 26-59
{
    NFA_SINGLE_NOKI,                //EN Single childless
    NFA_SINGLE_YOKI,                //EN Single young child(ren)
    NFA_SINGLE_OLKI,                //EN Single older child(ren)
    NFA_COUPLE_NOKI,                //EN Couple childless
    NFA_COUPLE_YOKI,                //EN Couple young child(ren)
    NFA_COUPLE_OLKI                 //EN Couple older child(ren)
};

classification NTA_FAMILY_OLD       //EN Family type of adults 60+
{
    NFR_SINGLE_NOKI,                //EN Single childless
    NFR_SINGLE_KI,                  //EN Single ever parent
    NFR_COUPLE_NOKI,                //EN Couple childless
    NFR_COUPLE_KI                   //EN Couple ever parent
};

range NTA_AGE_CHILD { 0, 16 };      //EN NTA child age range
range NTA_AGE_YOUNG { 17, 25 };     //EN NTA young age range
range NTA_AGE_WORK { 26, 59 };      //EN NTA prime work age range
range NTA_AGE_OLD { 60, 105 };      //EN NTA old age range

classification NTA_VARIABLES        //EN NTA Variables
{
    CFE,            //EN Private Consumption Education (CFE)
    CFH,            //EN Private Consumption Health (CFH)
    CFX,            //EN Private Consumption other than Education and Health (CFX)
    CGE,            //EN Public Consumption Education (CGE)
    CGH,            //EN Public Consumption Health (CGH)
    CGX,            //EN Public Consumption other than Education and Health (CGX)
    TGSOAI,         //EN Public Transfers Pensions, Inflows (TGSOAI)
    TGXCI,          //EN Public Transfers Other Cash Inflows (TGXCI)
    TGXII,          //EN Public Transfers Other In-Kind Inflows (TGXII)
    TGEI,           //EN Public Transfers Education Inflows (TGEI)
    TGHI,           //EN Public Transfers Health Inflows (TGHI)
    TGO,            //EN Public Transfers Outflows (TGO)
    TFB,            //EN Net Interhousehold Transfers (TFB)
    TFW,            //EN Net Intrahousehold Transfers (TFW)
    SF,             //EN Private Saving (SF)
    SG,             //EN Public Saving (SG)
    YL,             //EN Labor Income (LY)
    YAF,            //EN Private Asset Income (YAF)
    YAG             //EN Public Asset Income (YAG)
};

classification NTA_OWN_EDUC //EN Own education
{
    NOE_LOW,        //EN Low
    NOE_MEDIUM,     //EN Medium
    NOE_HIGH        //EN High
};

classification NTA_PAR_EDUC  //EN Parents education
{
    NPE_LOW,        //EN Low
    NPE_MEDIUM,     //EN Medium
    NPE_HIGH        //EN High
};

classification NTA_SCENARIO //EN NTA scenario
{
    NS_AGE,         //EN NTA by age
    NS_SEX,         //EN NTA by age and sex
    NS_FAM          //EN NTA by age, sex, education and family type
};

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

parameters
{
    //EN NTA Scenario Selection
    NTA_SCENARIO NtaScenario;

    //EN NTA Children 0-16
    double NtaChild[NTA_PAR_EDUC][NTA_AGE_CHILD][NTA_VARIABLES];

    //EN NTA Students 17-25
    double NtaYoungStudent[NTA_PAR_EDUC][NTA_AGE_YOUNG][NTA_VARIABLES];

    //EN NTA Non-Students 17-25
    double NtaYoungWork[SEX][NTA_OWN_EDUC][NTA_FAMILY_ACTIVE][NTA_AGE_YOUNG][NTA_VARIABLES];

    //EN NTA Adults 26-59
    double NtaAdultWorkAge[SEX][NTA_OWN_EDUC][NTA_FAMILY_ACTIVE][NTA_AGE_WORK][NTA_VARIABLES];

    //EN NTA Adults 60+
    double NtaAdultOldAge[SEX][NTA_OWN_EDUC][NTA_FAMILY_OLD][NTA_AGE_OLD][NTA_VARIABLES];

    //EN NTA by age only
    double NtaAge[AGE_RANGE][NTA_VARIABLES];

    //EN NTA by age and sex only
    double NtaSex[SEX][AGE_RANGE][NTA_VARIABLES];
};

parameter_group PG_NTA_Published                            //EN Published NTA data
{
    NtaAge, NtaSex
};

parameter_group PG_NTA_Refined                              //EN NTA by family and education
{

    NtaChild, NtaYoungStudent, NtaYoungWork,
    NtaAdultWorkAge, NtaAdultOldAge
};

parameter_group PG_NTA                                      //EN NTA Variables
{
    NtaScenario,
    PG_NTA_Published,
    PG_NTA_Refined
};

///////////////////////////////////////////////////////////////////////////////////////////////////
// Actor
////////////////////////////////////////////////////////////////////////////////////////////////////

actor Person
{
    //EN NTA Population Group
    NTA_POP_GROUP nta_pop_group =
        (WITHIN(NTA_AGE_CHILD,integer_age)) ? NPG_CHILD :
        (WITHIN(NTA_AGE_YOUNG,integer_age) && is_student) ? NPG_YOUNG_STUDENT :
        (WITHIN(NTA_AGE_YOUNG,integer_age)) ? NPG_YOUNG_WORK :
        (WITHIN(NTA_AGE_WORK,integer_age)) ? NPG_ADULT_WORK : NPG_OLD;

    //EN Student
    logical is_student = (educ_status == ES_FULLTIME || educ_status == ES_PARTTIME
        || educ_status == ES_DUAL || in_other_education) ? TRUE : FALSE;

    //EN Age Index
    integer nta_age_index = (WITHIN(NTA_AGE_CHILD, integer_age)) ? integer_age :
        (WITHIN(NTA_AGE_YOUNG, integer_age)) ? integer_age - MIN(NTA_AGE_YOUNG) :
        (WITHIN(NTA_AGE_WORK, integer_age)) ? integer_age - MIN(NTA_AGE_WORK)
        : integer_age - MIN(NTA_AGE_OLD);

    //EN NTA Education
    EDUC_LEVEL3 nta_educ = (nta_pop_group == NPG_CHILD || nta_pop_group == NPG_YOUNG_STUDENT) ?
        educ_parents : educ_fate;

    //EN NTA Family Type Index Workers
    integer nta_fam_index = (nta_pop_group == NPG_YOUNG_WORK || nta_pop_group == NPG_ADULT_WORK) ?
        (
        (!has_partner) ?
            (
            (sex == FEMALE && age_youngest_child < 3) ? NFA_SINGLE_YOKI :
                (sex == FEMALE && age_youngest_child < 18) ? NFA_SINGLE_OLKI :
                NFA_SINGLE_NOKI
                )
            :
            (
            ((sex == FEMALE && age_youngest_child < 3) || (sex == MALE && lSpouse->age_youngest_child < 3)) ? NFA_COUPLE_YOKI :
                ((sex == FEMALE && age_youngest_child < 18) || (sex == MALE && lSpouse->age_youngest_child < 18)) ? NFA_COUPLE_OLKI :
                NFA_COUPLE_NOKI
                )
            ) : 0;


     integer nta_old_index = (nta_pop_group == NPG_OLD) ?
        (
             (!has_partner) ?
                (
                    ((sex==MALE && never_father) || (sex==FEMALE && !is_mother)) ? NFR_SINGLE_NOKI : NFR_SINGLE_KI
                )
            :
                (
                    ((sex==MALE && never_father) || (sex==FEMALE && !is_mother)) ? NFR_COUPLE_NOKI : NFR_COUPLE_KI
                )
        )
        : 0;


        //EN Private Consumption Education (CFE)
        double base_CFE =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][CFE] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][CFE] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][CFE] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][CFE] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][CFE] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][CFE] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][CFE];
        //EN Private Consumption Health (CFH)
        double base_CFH =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][CFH] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][CFH] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][CFH] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][CFH] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][CFH] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][CFH] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][CFH];

        //EN Private Consumption other than Education and Health (CFX)
        double base_CFX =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][CFX] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][CFX] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][CFX] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][CFX] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][CFX] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][CFX] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][CFX];

        //EN Public Consumption Education (CGE)
        double base_CGE =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][CGE] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][CGE] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][CGE] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][CGE] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][CGE] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][CGE] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][CGE];

        //EN Public Consumption Health (CGH)
        double base_CGH =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][CGH] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][CGH] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][CGH] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][CGH] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][CGH] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][CGH] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][CGH];

        //EN Public Consumption other than Education and Health (CGX)
        double base_CGX =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][CGX] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][CGX] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][CGX] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][CGX] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][CGX] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][CGX] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][CGX];

        //EN Public Transfers Pensions, Inflows (TGSOAI)
        double base_TGSOAI =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][TGSOAI] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][TGSOAI] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][TGSOAI] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][TGSOAI] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][TGSOAI] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][TGSOAI] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][TGSOAI];

        //EN Public Transfers Other Cash Inflows (TGXCI)
        double base_TGXCI =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][TGXCI] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][TGXCI] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][TGXCI] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][TGXCI] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][TGXCI] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][TGXCI] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][TGXCI];

        //EN Public Transfers Other In-Kind Inflows (TGXII)
        double base_TGXII =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][TGXII] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][TGXII] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][TGXII] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][TGXII] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][TGXII] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][TGXII] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][TGXII];

        //EN Public Transfers Health Outflows (TGEI)
        double base_TGEI =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][TGEI] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][TGEI] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][TGEI] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][TGEI] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][TGEI] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][TGEI] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][TGEI];

        //EN Public Transfers Health Outflows (TGHI)
        double base_TGHI =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][TGHI] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][TGHI] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][TGHI] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][TGHI] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][TGHI] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][TGHI] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][TGHI];


        //EN Public Transfers Education Outflows (TGO)
        double base_TGO =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][TGO] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][TGO] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][TGO] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][TGO] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][TGO] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][TGO] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][TGO];

        //EN Net Interhousehold Transfers (TFB)
        double base_TFB =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][TFB] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][TFB] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][TFB] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][TFB] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][TFB] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][TFB] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][TFB];

        //EN Net Intrahousehold Transfers (TFW)
        double base_TFW =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][TFW] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][TFW] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][TFW] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][TFW] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][TFW] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][TFW] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][TFW];

        //EN Private Saving (SF)
        double base_SF =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][SF] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][SF] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][SF] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][SF] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][SF] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][SF] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][SF];

        //EN Public Saving (SG)
        double base_SG =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][SG] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][SG] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][SG] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][SG] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][SG] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][SG] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][SG];

        //EN Labor Inclome (LY)
        double base_YL =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][YL] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][YL] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][YL] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][YL] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][YL] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][YL] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][YL];

        //EN Private Asset Income (YAF)
        double base_YAF =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][YAF] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][YAF] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][YAF] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][YAF] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][YAF] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][YAF] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][YAF];

        //EN Public Asset Income (YAG)
        double base_YAG =
            (NtaScenario == NS_AGE) ?               NtaAge[integer_age][YAG] :
            (NtaScenario == NS_SEX) ?               NtaSex[sex][integer_age][YAG] :
            (nta_pop_group == NPG_CHILD) ?          NtaChild[nta_educ][nta_age_index][YAG] :
            (nta_pop_group == NPG_YOUNG_STUDENT) ?  NtaYoungStudent[nta_educ][nta_age_index][YAG] :
            (nta_pop_group == NPG_YOUNG_WORK) ?     NtaYoungWork[sex][nta_educ][nta_fam_index][nta_age_index][YAG] :
            (nta_pop_group == NPG_ADULT_WORK) ?     NtaAdultWorkAge[sex][nta_educ][nta_fam_index][nta_age_index][YAG] :
                                                    NtaAdultOldAge[sex][nta_educ][nta_old_index][nta_age_index][YAG];
};

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

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

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

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