Data Cart

Your data extract

0 variables
0 samples
View Cart
LASTBMORT
Mortality status of last birth

Codes and Frequencies



An 'X' indicates the category is available for that sample

0NIU (not in universe)XXXXXXXXXXXXXXX0NIU (not in universe)XXXXXXXXXXXXXXX0NIU (not in universe)XXXXXXXXXXXXXXX
1AliveXXXXXXXXXXXXXXX1AliveXXXXXXXXXXXXXXX1AliveXXXXXXXXXXXXXXX
2DeadXXXXXXXXXXXXXXX2DeadXXXXXXXXXXXXXXX2DeadXXXXXXXXXXXXXXX
9UnknownX·XXX·X·XXX·XXX9Unknown·XXXXXXXX··X··X9UnknownXXXXXXXXXXX··XX

Explore how IPUMS created this variable

Download


      class Lastbmort : public Editor {

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

    long a = getRecoded();
    switch (dataSet) {
    case dataset_id::vn1989a: {
      if (VN1989A_0427() == 0 && VN1989A_0428() == 1)
        a = 2;
      if (VN1989A_0427() == 1 && VN1989A_0428() == 0)
        a = 1;
      if (VN1989A_0427() + VN1989A_0428() != 1)
        a = 9;
      if (VN1989A_0427() == 9 || VN1989A_0427() == 9)
        a = 0;
    } break;
    case dataset_id::vn1999a: {
      int c = VN1999A_0440();
      int d = VN1999A_0441();
      if (c == 2)
        c = VN1999A_0440.getSourceDataAsLong();
      if (d == 2)
        d = VN1999A_0441.getSourceDataAsLong();
      int e = VN1999A_0442();
      int f = VN1999A_0443();
      if (c + d == 1 && e + f == 0)
        a = 1;
      if (c + d == 1 && e + f == 1)
        a = 2;
      if (c + d > 1 || e + f > 1)
        a = 9;
      if (c == 8 || d == 8 || e == 8 || f == 8)
        a = 9;
      if (c == 9 || d == 9 || e == 9 || f == 9)
        a = 0;
    } break;
    }

    setData(a);
  }
};