Data Cart

Your data extract

0 variables
0 samples
View Cart

INCEARN is an 8-digit numeric variable.

Codes

99999998 = Unknown/missing.
99999999 = NIU (not in universe).

Top codes:

Canada 1971: 50,000+
Canada 1981: 75,000+
Canada 2001: 200,000+
Israel 1972: 16,000+
Israel 2008: 275,653+
Mexico 1990: 90,000,000+
Mexico 2000: 999,998+
Mexico 2010-2020: 1,000,000+
Panama 2000: 9,997+
Puerto Rico 1990: 999,999+
Puerto Rico 2000: 310,000+
U.S.A. 1990: State median of values over 284,000
U.S.A. 2000: 310,000+
U.S.A. 2005: 9,999,999+
Venezuela 1971: 2000+

Bottom codes:

Canada 1981-2001: -50,000
Puerto Rico 1990-2020: -9,999
U.S.A. 1990: -19,996
U.S.A. 2000-2005, 2015-2020: -9,999
U.S.A. 2010: -9,900

Explore how IPUMS created this variable

Download


      class Incearn : public Editor {

public:
  Incearn(VarPointer varInfo) : Editor(varInfo) {}
  void edit() {

    long a = getRecoded();
    long unknown = 99999998;
    long niu = 99999999;
    switch (dataSet) {
    case dataset_id::br1980a: {
      long a1 = BR1980A_0437();
      long a2 = BR1980A_0443();
      a = a1 + a2;
      if (a1 == 9999998 || a2 == 9999999)
        a = unknown;
      if (a1 == 9999999 && a2 == 0)
        a = niu;
    } break;
    case dataset_id::br1991a: {
      long a1 = BR1991A_0460();
      long a2 = BR1991A_0465();
      a = a1 + a2;
      if (a1 == 9999998 || a1 == 9999999 || a2 == 9999998 || a2 == 9999999)
        a = unknown;
      if (a1 == 9999999 && a2 == 9999999)
        a = niu;
    } break;
    case dataset_id::br2000a: {
      long a1 = BR2000A_0524();
      if (a1 == 999999)
        a = niu;
    } break;
    case dataset_id::mx1960a: {
      if (MX1960A_0432() == 99999)
        a = unknown;
    } break;
    case dataset_id::mx2000a: {
      if (MX2000A_0447() == 9999999 && MX2000A_0402() >= 12)
        a = 0;
      if (MX2000A_0447() == 9999998)
        a = unknown;
      if (MX2000A_0402() < 12)
        a = niu;
    } break;
    case dataset_id::mx1990a: {
      if (MX1990A_0436() == 0 && MX1990A_0404() < 12)
        a = niu;
      if (MX1990A_0436() >= 99999997)
        a = unknown;
      if (MX1990A_0436() > 90000000 && MX1990A_0436() < 99999997)
        a = 90000000;
    } break;
    case dataset_id::ve1981a: {
      if (VE1981A_0428() == 2)
        a = VE1981A_0429() * 4;
      if (VE1981A_0428() == 3)
        a = VE1981A_0429() * 20;
      if (VE1981A_0428() == 8 || VE1981A_0429() == 99998)
        a = unknown;
      if (VE1981A_0428() == 9 || VE1981A_0429() == 99999)
        a = niu;
    } break;
    case dataset_id::ve1990a: {
      if (VE1990A_0414() == 99998)
        a = unknown;
      if (VE1990A_0414() == 99999)
        a = niu;
    } break;
    case dataset_id::ca1971a: {
      long a1 = CA1971A_0441();
      long a2 = CA1971A_0442();
      a = a1 + a2;
      if (a >= 50000)
        a = 50000;
      if (a1 == 99999 || a2 == 99999)
        a = niu;
    } break;
    case dataset_id::ca1981a: {
      long a1 = CA1981A_0450();
      long a2 = CA1981A_0451();
      a = a1 + a2;
      if (a >= 75000)
        a = 75000;
      if (a2 == -20000)
        a = -20000;
      if (a1 == 999999 || a2 == 999999)
        a = niu;
    } break;
    case dataset_id::ca1991a: {
      long a1 = CA1991A_0490();
      long a2 = CA1991A_0491();
      a = a1 + a2;
      if (a2 == -20000)
        a = -20000;
      if (a1 == 9999999 || a2 == 9999999)
        a = niu;
    } break;
    case dataset_id::ca2001a: {
      long a1 = CA2001A_0513();
      long a2 = CA2001A_0514();
      a = a1 + a2;
      if (a >= 200000)
        a = 200000;
      if (a2 == -20000)
        a = -20000;
      if (a1 == 9999999 || a2 == 9999999)
        a = niu;
    } break;
    case dataset_id::mx1995a: {
      if (MX1995A_0435() == 999999 && MX1995A_0404() >= 12)
        a = 0;
    } break;
    case dataset_id::pa1990a: {
      if (PA1990A_0444() == 99998)
        a = unknown;
      if (PA1990A_0444() == 99999)
        a = niu;
    } break;
    case dataset_id::pa2000a: {
      long a1 = PA2000A_0438();
      long a2 = PA2000A_0439();
      a = a1 + a2;
      if (a >= 9997)
        a = 9997;
      if (a1 == 9998 || a2 == 9998)
        a = unknown;
      if (a1 == 9999 || a2 == 9999)
        a = niu;
    } break;
    case dataset_id::us2005a: {
      if (US2005A_0654() == 99999)
        a = niu;
    } break;
    case dataset_id::mx2010a: {
      if (MX2010A_0462() == 999999 && MX2010A_0403() >= 12 &&
          MX2010A_0403() <= 999)
        a = 0;
    } break;
    case dataset_id::pa2010a: {
      long a1 = PA2010A_0442();
      long a2 = PA2010A_0443();
      long a3 = PA2010A_0444();
      long a4 = PA2010A_0453();
      a = a1 + a2 + a3 + a4;
      if (a1 == 99999 || a2 == 99999 || a3 == 99999 || a4 == 99999)
        a = unknown;
    } break;
    case dataset_id::tt2000a: {
      long a1 = TT2000A_0508();
      long a2 = TT2000A_0509();
      a = a1 + a2;
      if (a >= 11000)
        a = 11000;
      if (a1 == 99999998 || a2 == 99999998)
        a = unknown;
      if (a1 == 99999999 || a2 == 99999999)
        a = niu;
    } break;
    case dataset_id::il2008a: {
      long b = 0;
      long c = 0;
      if (IL2008A_0467() == 1)
        b = 1619;
      if (IL2008A_0467() == 2)
        b = 5230;
      if (IL2008A_0467() == 3)
        b = 9414;
      if (IL2008A_0467() == 4)
        b = 13903;
      if (IL2008A_0467() == 5)
        b = 18591;
      if (IL2008A_0467() == 6)
        b = 23471;
      if (IL2008A_0467() == 7)
        b = 28599;
      if (IL2008A_0467() == 8)
        b = 34082;
      if (IL2008A_0467() == 9)
        b = 39662;
      if (IL2008A_0467() == 10)
        b = 45227;
      if (IL2008A_0467() == 11)
        b = 51208;
      if (IL2008A_0467() == 12)
        b = 58295;
      if (IL2008A_0467() == 13)
        b = 67189;
      if (IL2008A_0467() == 14)
        b = 78075;
      if (IL2008A_0467() == 15)
        b = 91493;
      if (IL2008A_0467() == 16)
        b = 108947;
      if (IL2008A_0467() == 17)
        b = 132615;
      if (IL2008A_0467() == 18)
        b = 168359;
      if (IL2008A_0467() == 19)
        b = 235173;
      if (IL2008A_0467() == 20)
        b = 279950;
      if (IL2008A_0465() == 1)
        c = 1087;
      if (IL2008A_0465() == 2)
        c = 3817;
      if (IL2008A_0465() == 3)
        c = 7705;
      if (IL2008A_0465() == 4)
        c = 12577;
      if (IL2008A_0465() == 5)
        c = 18265;
      if (IL2008A_0465() == 6)
        c = 24587;
      if (IL2008A_0465() == 7)
        c = 31387;
      if (IL2008A_0465() == 8)
        c = 38463;
      if (IL2008A_0465() == 9)
        c = 45331;
      if (IL2008A_0465() == 10)
        c = 52045;
      if (IL2008A_0465() == 11)
        c = 59141;
      if (IL2008A_0465() == 12)
        c = 67020;
      if (IL2008A_0465() == 13)
        c = 76043;
      if (IL2008A_0465() == 14)
        c = 86787;
      if (IL2008A_0465() == 15)
        c = 99243;
      if (IL2008A_0465() == 16)
        c = 115885;
      if (IL2008A_0465() == 17)
        c = 140325;
      if (IL2008A_0465() == 18)
        c = 176153;
      if (IL2008A_0465() == 19)
        c = 236635;
      if (IL2008A_0465() == 20)
        c = 275653;
      if (IL2008A_0465() <= 99 && IL2008A_0467() <= 99)
        a = b + c;
      if (a >= 275653)
        a = 275653;
      if (IL2008A_0465() == 98 || IL2008A_0467() == 98)
        a = 99999998;
      if (IL2008A_0465() == 99 && IL2008A_0467() == 99)
        a = 99999999;
    } break;
    case dataset_id::mx2005h:
    case dataset_id::mx2005i:
    case dataset_id::mx2005j:
    case dataset_id::mx2005k:
    case dataset_id::mx2006h:
    case dataset_id::mx2006i:
    case dataset_id::mx2006j:
    case dataset_id::mx2006k:
    case dataset_id::mx2007h:
    case dataset_id::mx2007i:
    case dataset_id::mx2007j:
    case dataset_id::mx2007k:
    case dataset_id::mx2008h:
    case dataset_id::mx2008i:
    case dataset_id::mx2008j:
    case dataset_id::mx2008k:
    case dataset_id::mx2009h:
    case dataset_id::mx2009i:
    case dataset_id::mx2009j:
    case dataset_id::mx2009k:
    case dataset_id::mx2010h:
    case dataset_id::mx2010i:
    case dataset_id::mx2010j:
    case dataset_id::mx2010k:
    case dataset_id::mx2011h:
    case dataset_id::mx2011i:
    case dataset_id::mx2011j:
    case dataset_id::mx2011k:
    case dataset_id::mx2012h:
    case dataset_id::mx2012i:
    case dataset_id::mx2012j:
    case dataset_id::mx2012k:
    case dataset_id::mx2013h:
    case dataset_id::mx2013i:
    case dataset_id::mx2013j:
    case dataset_id::mx2013k:
    case dataset_id::mx2014h:
    case dataset_id::mx2014i:
    case dataset_id::mx2014j:
    case dataset_id::mx2014k:
    case dataset_id::mx2015h:
    case dataset_id::mx2015i:
    case dataset_id::mx2015j:
    case dataset_id::mx2015k:
    case dataset_id::mx2016h:
    case dataset_id::mx2016i:
    case dataset_id::mx2016j:
    case dataset_id::mx2016k:
    case dataset_id::mx2017h:
    case dataset_id::mx2017i:
    case dataset_id::mx2017j:
    case dataset_id::mx2017k:
    case dataset_id::mx2018h:
    case dataset_id::mx2018i:
    case dataset_id::mx2018j:
    case dataset_id::mx2018k:
    case dataset_id::mx2019h:
    case dataset_id::mx2019i:
    case dataset_id::mx2019j:
    case dataset_id::mx2019k:
    case dataset_id::mx2020h:
    case dataset_id::mx2020j: {
      long econact = valueFromFirstAvailable(
          {MX2005H_0457_ref, MX2005I_0457_ref, MX2005J_0457_ref,
           MX2005K_0457_ref, MX2006H_0457_ref, MX2006I_0457_ref,
           MX2006J_0457_ref, MX2006K_0457_ref, MX2007H_0457_ref,
           MX2007I_0457_ref, MX2007J_0457_ref, MX2007K_0457_ref,
           MX2008H_0457_ref, MX2008I_0457_ref, MX2008J_0457_ref,
           MX2008K_0457_ref, MX2009H_0457_ref, MX2009I_0457_ref,
           MX2009J_0457_ref, MX2009K_0457_ref, MX2010H_0457_ref,
           MX2010I_0457_ref, MX2010J_0457_ref, MX2010K_0457_ref,
           MX2011H_0457_ref, MX2011I_0457_ref, MX2011J_0457_ref,
           MX2011K_0457_ref, MX2012H_0457_ref, MX2012I_0457_ref,
           MX2012J_0457_ref, MX2012K_0457_ref, MX2013H_0457_ref,
           MX2013I_0457_ref, MX2013J_0457_ref, MX2013K_0457_ref,
           MX2014H_0457_ref, MX2014I_0457_ref, MX2014J_0457_ref,
           MX2014K_0457_ref, MX2015H_0457_ref, MX2015I_0457_ref,
           MX2015J_0457_ref, MX2015K_0457_ref, MX2016H_0457_ref,
           MX2016I_0457_ref, MX2016J_0457_ref, MX2016K_0457_ref,
           MX2017H_0457_ref, MX2017I_0457_ref, MX2017J_0457_ref,
           MX2017K_0457_ref, MX2018H_0457_ref, MX2018I_0457_ref,
           MX2018J_0457_ref, MX2018K_0457_ref, MX2019H_0457_ref,
           MX2019I_0457_ref, MX2019J_0457_ref, MX2019K_0457_ref,
           MX2020H_0457_ref, MX2020J_0457_ref});
      long incmon = valueFromFirstAvailable(
          {MX2005H_0494_ref, MX2005I_0494_ref, MX2005J_0494_ref,
           MX2005K_0494_ref, MX2006H_0494_ref, MX2006I_0494_ref,
           MX2006J_0494_ref, MX2006K_0494_ref, MX2007H_0494_ref,
           MX2007I_0494_ref, MX2007J_0494_ref, MX2007K_0494_ref,
           MX2008H_0494_ref, MX2008I_0494_ref, MX2008J_0494_ref,
           MX2008K_0494_ref, MX2009H_0494_ref, MX2009I_0494_ref,
           MX2009J_0494_ref, MX2009K_0494_ref, MX2010H_0494_ref,
           MX2010I_0494_ref, MX2010J_0494_ref, MX2010K_0494_ref,
           MX2011H_0494_ref, MX2011I_0494_ref, MX2011J_0494_ref,
           MX2011K_0494_ref, MX2012H_0494_ref, MX2012I_0494_ref,
           MX2012J_0494_ref, MX2012K_0494_ref, MX2013H_0494_ref,
           MX2013I_0494_ref, MX2013J_0494_ref, MX2013K_0494_ref,
           MX2014H_0494_ref, MX2014I_0494_ref, MX2014J_0494_ref,
           MX2014K_0494_ref, MX2015H_0494_ref, MX2015I_0494_ref,
           MX2015J_0494_ref, MX2015K_0494_ref, MX2016H_0494_ref,
           MX2016I_0494_ref, MX2016J_0494_ref, MX2016K_0494_ref,
           MX2017H_0494_ref, MX2017I_0494_ref, MX2017J_0494_ref,
           MX2017K_0494_ref, MX2018H_0494_ref, MX2018I_0494_ref,
           MX2018J_0494_ref, MX2018K_0494_ref, MX2019H_0494_ref,
           MX2019I_0494_ref, MX2019J_0494_ref, MX2019K_0494_ref,
           MX2020H_0494_ref, MX2020J_0494_ref});
      if (econact == 1 && incmon == 0) {
        a = 99999998;
      }
    } break;
    }

    setData(a);
  }
};