Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating individual-level variables representing the characteristics of co-resident persons (e.g. age of mother)

    Hello. I am using CPS data and am trying to transform the data using the household id number, the line number of each household member, and the pointer variables (pelnmom, pemomtyp) to create a variable similar to the iPUMS variable "age_mom" in each child record for the household. Does anyone know how to perform these data manipulations? Here is a sample of my data:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str15 hrhhid byte(hrnumhou pulineno perrp peparent pelnmom pemomtyp)
    "000008177510065" 5 1  1 -1 -1 -1
    "000008177510065" 5 2  4  1  5  1
    "000008177510065" 5 3  4  1  5  1
    "000008177510065" 5 4  4  1  5  1
    "000008177510065" 5 5  3 -1 -1 -1
    "000095729503241" 5 1  1 -1 -1 -1
    "000095729503241" 5 2 14 -1 -1 -1
    "000095729503241" 5 3  4  1  1  1
    "000095729503241" 5 4  4  1  1  1
    "000095729503241" 5 5  4  1  1  1
    "000110105457754" 4 1  1 -1 -1 -1
    "000110105457754" 4 2  3 -1 -1 -1
    "000110105457754" 4 3  4  1  1  1
    "000110105457754" 4 4  4  1  1  1
    "000110696829571" 3 1  1 -1 -1 -1
    "000110696829571" 3 2  3 -1 -1 -1
    "000110696829571" 3 3  4  1  2  1
    "000110761517565" 5 1  1 -1 -1 -1
    "000110761517565" 5 2  3 -1 -1 -1
    "000110761517565" 5 3  4  1  1  2
    "000110761517565" 5 4  4  1  1  1
    "000110761517565" 5 5  4  1  1  1
    "000110867003104" 2 1  1 -1 -1 -1
    "000110867003104" 1 1  2 -1 -1 -1
    "000110867003104" 2 2  4  1  1  1
    "000111140228235" 5 1  1 -1 -1 -1
    "000111140228235" 5 2  3 -1 -1 -1
    "000111140228235" 5 3  4  1  1  1
    "000111140228235" 5 4  4  1  1  1
    "000111140228235" 5 5  4  1  1  1
    "000210389452957" 3 1  1 -1 -1 -1
    "000210389452957" 3 2  3 -1 -1 -1
    "000210389452957" 3 3  4  1  1  1
    "000212395287254" 3 1  1 -1 -1 -1
    "000212395287254" 3 2  4  1  1  1
    "000212395287254" 3 3 14 -1 -1 -1
    "000305182710666" 4 1  1 -1 -1 -1
    "000305182710666" 1 1  2 -1 -1 -1
    "000305182710666" 4 2  3 -1 -1 -1
    "000305182710666" 4 3  4  1  1  1
    "000305182710666" 4 4  5  3  3  1
    "000402158810668" 4 1  1 -1 -1 -1
    "000402158810668" 4 2  3 -1 -1 -1
    "000402158810668" 4 3  4  1  2  1
    "000402158810668" 4 4  4  1  2  1
    "000406210710975" 4 1  1 -1 -1 -1
    "000406210710975" 4 2  3 -1 -1 -1
    "000406210710975" 4 3  4  1  2  1
    "000406210710975" 4 4  4  1  2  1
    "000410122486109" 4 1  1 -1 -1 -1
    "000410122486109" 4 2  3  3 -1 -1
    "000410122486109" 4 3  8 -1 -1 -1
    "000410122486109" 4 4  4  1  1  1
    "000411552955942" 3 1  1 -1 -1 -1
    "000411552955942" 3 2  3 -1 -1 -1
    "000411552955942" 3 3  4  1  1  1
    "000412153710568" 5 1  1 -1 -1 -1
    "000412153710568" 5 2  3 -1 -1 -1
    "000412153710568" 5 3  4  1  2  1
    "000412153710568" 5 4  4  1  2  1
    "000412153710568" 5 5  4  1  2  1
    "000510253453453" 5 1  1 -1 -1 -1
    "000510253453453" 5 2  3 -1 -1 -1
    "000510253453453" 5 3  4  1  1  1
    "000510253453453" 5 4  4  1  1  1
    "000510253453453" 5 5  4  1  1  1
    "000510310921951" 4 1  1 -1 -1 -1
    "000510310921951" 4 2  3 -1 -1 -1
    "000510310921951" 4 3  4  1  2  1
    "000510310921951" 4 4  4  1  2  1
    "000510466723495" 4 1  1 -1 -1 -1
    "000510466723495" 4 2  3 -1 -1 -1
    "000510466723495" 4 3  4  1  1  1
    "000510466723495" 4 4  4  1  1  1
    "000510468724429" 4 1  1 -1 -1 -1
    "000510468724429" 4 2  3 -1 -1 -1
    "000510468724429" 4 3 12 -1 -1 -1
    "000510468724429" 4 4  4  1  2  1
    "000510495685926" 4 1  1 -1 -1 -1
    "000510495685926" 4 2  3 -1 -1 -1
    "000510495685926" 4 3  4  1  2  1
    "000510495685926" 4 4  4  1  2  1
    "000610238845684" 5 1  1 -1 -1 -1
    "000610238845684" 5 2  3 -1 -1 -1
    "000610238845684" 5 3  4  1  1  1
    "000610238845684" 5 4  4  1  1  1
    "000610238845684" 5 5  4  1  1  1
    "000610463416226" 5 1  1 -1 -1 -1
    "000610463416226" 5 2  4  1  1  1
    "000610463416226" 5 3  4  1  1  1
    "000610463416226" 5 4  4  1  1  1
    "000610463416226" 5 5  4  1  1  1
    "000610479677071" 6 1  1 -1 -1 -1
    "000610479677071" 6 2  3 -1 -1 -1
    "000610479677071" 6 3  4  1  2  1
    "000610479677071" 6 4  4  1  2  1
    "000610479677071" 6 5  4  1  2  1
    "000610479677071" 6 6  4  1  2  1
    "000610740988136" 3 1  1 -1 -1 -1
    "000610740988136" 2 1  2 -1 -1 -1
    end
    label values perrp perrp
    label def perrp 1 "REFERENCE PERSON W/RELS.", modify
    label def perrp 2 "REFERENCE PERSON W/O RELS.", modify
    label def perrp 3 "SPOUSE", modify
    label def perrp 4 "CHILD", modify
    label def perrp 5 "GRANDCHILD", modify
    label def perrp 8 "OTHER REL. OR REF. PERSON", modify
    label def perrp 12 "NONREL. OF REF. PERSON W/O RELS.", modify
    label def perrp 14 "UNMARRIED PARTNER W/OUT RELS.", modify
    label values peparent peparent
    label def peparent -1 "NO PARENT", modify
    label values pelnmom pelnmom
    label def pelnmom -1 "NO MOTHER PRESENT", modify
    Attached Files

  • #2
    You'll have better luck getting an answer if you can tell us some of the things that you know about here but about which we can only puzzle or guess. In particular: How do your pointer variables work here? What is it that iPUMS does that you want? Which variable is your line number variable?

    I would note that I have created and used pointers, and line numbers, and I'm a sometime user of iPUMS, so if what you ask here is opaque to me, it likely is so to others, too. And CPS has many different meanings as well beyond Current Population Survey, something that is known to U.S. sociologists, economists, and demographers, but not like to the many participants on Stata List outside the U.S. and these professions. If its referent doesn't help in explaining your question, leaving it out is preferable.

    Comment

    Working...
    X