Data Cart

Your data extract

0 variables
0 samples
View Cart

Codes and Frequencies



Loading Frequency Data...

Can't find the category you are looking for? Try the Detailed codes

Explore how IPUMS created this variable

Download


      class Sex : public Editor {

public:
  Sex(VarPointer varInfo) : Editor(varInfo) {}

  // TODO check isMarried for correctness
  //    bool isMarried(int p) {
  //        return MARST(p) == 200;

  //    }

  void edit() {

    long a = getRecoded();

    switch (dataSet) {
    case dataset_id::co1985a: {

      if (countPeople() > 1) {

        if ((PERNUM() == 1 || PERNUM() == 2) &&
            CO1985A_0402(1) == CO1985A_0402(2) && CO1985A_0401(2) == 2 &&
            CO1985A_0401(1) == 1 && isMarried(1) && isMarried(2) &&
            labs(AGE(1) - AGE(2)) < 12) {
          if (PERNUM() == 2)
            a = 2;
          if (PERNUM() == 1)
            a = 1;
        }
      }
    } break;
    }

    setData(a);
  }
};