Announcement

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

  • Year matching

    Hello,

    I have a sample of evermarried women from two waves of a longitudinal survey in one consolidated long dataset, their unique id (ID_PERSON), their HH rooster id (PERSONID) their HH rooster id in the first wave (PID2005) , HH rooster ID of their mother (SPRO10) , years since death of a member (TH3), died members 2005 id (TH1).

    Since data is collected on death of HH members in wave 2 ,TH3==1 means its been a year since they died.
    So If the second wave was in 2009, the HH member would have died in 2008.

    So corresponding to each eligible women ID I want to have a variable that shows TH3 for their mother ie, years since their mother died.
    How will I be able to do that?



    Code:
    dataex ID_PERSON PID2005 PERSONID SPRO10 TH1 TH3 if TH1!=.
    
    ----------------------- copy starting from the next line -----------------------
    
    
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input double ID_PERSON int PID2005 float PERSONID int(SPRO10 TH1 TH3)
     10308020102  4  2 75  2 2
     11201020102  4  2 75  2 3
     11203080102  4  2 75  2 5
     11306040102  4  2 75  2 6
     11314050102 15  2 75  2 .
     30108060102  4  2 75  2 4
     31104221102  4  2 75  2 1
     60303030102  4  2 75  2 3
     61202141103 11  3  1  3 2
     61204170102  4  2 75  2 3
     61301081102  3  2 75  2 5
     61303091102 13  2 75  2 7
     61304071102  4  2 75  2 0
     61810011102  4  2 75  2 1
     81801060102  4  2 75  2 0
     82409050102  4  2 75  2 4
     90107130102  4  2 75  2 2
     93403070202  4  2 75  2 1
     94005150102  4  2 75  2 3
     94906120102  4  2 75  2 3
     96602170102  7  2 75  2 1
     10203130102  3  2  .  2 6
     10203190102  4  2 75  2 5
    102712071102  5  2 75  2 4
     10305050110  9 10 75 10 3
    182103030102  4  2 75  2 6
    191103141102  4  2 75  2 1
    201201161102  4  2 75  2 6
    201202010102  2  2  8  2 1
    201301120202  4  2 75  2 1
    201409130102  4  2 75  2 5
     20201211102  4  2 75  2 4
     20209140102  4  2 69  2 1
     20210020102  4  2 75  2 5
     20402101102  4  2 75  2 6
     20605160102 10  2 69  2 6
     20806090102  4  2 75  2 7
    210601011102  2  2  .  2 6
    210606100102  3  2 75  2 3
    211507010102  4  2  .  2 6
    212801160102  4  2 75  2 3
    230802271102  4  2 75  2 6
    231302011102  2  2  .  2 0
    232101011102  4  2 75  2 1
    241902171102  4  2 75  2 4
    271103010102  2  2  .  2 5
    272102150202  4  2 75  2 3
    272112060102  4  2 75  2 3
    272510050102  4  2 75  2 1
    272705051102  4  2 75  2 1
    272902120102  4  2 75  2 2
    273101091102  4  2 75  2 4
    281304071102  3  2 75  2 2
    282204161102  4  2 75  2 3
    291401080102  4  2 75  2 3
    291932161102  4  2 75  2 1
    292107040102  4  2 75  2 3
     30101031302 12  2 75  2 1
     30102121102  4  2 75  2 2
     30205100102  4  2 75  2 4
     30303051102  4  2 75  2 4
     30704081102  4  2 75  2 0
     30907010102  2  2  .  2 2
     31104131102  4  2 75  2 4
     31111042102  4  2 75  2 4
     31112321102  9  2 75  2 5
     31602031102  4  2 75  2 5
     31703050102  1  2 75  2 2
    320504120102  4  2 75  2 3
    330404060102  4  2  .  2 2
     50905010102  2  2 10  2 5
     51202081102  3  2 69  2 2
     51303011202  4  2 75  2 2
     60201251102  3  2 75  2 6
     60201281102  3  2 75  2 4
     60202111202  6  2  6  2 3
     60408170302  8  2 75  2 4
     60503261102  4  2 69  2 0
     60804091202  5  2 69  2 6
     60901061102  4  2 75  2 2
     60902101102  6  2 69  2 1
     61002011102  2  2  6  2 3
     61002052102  4  2 75  2 6
     61702061102  3  2 75  2 3
     61801011202  4  2 75  2 7
     61805060102  4  2 75  2 2
     61905170302  5  2 75  2 4
     70703010102  2  2  .  2 4
     71023150102  4  2 75  2 1
     71036090102  4  2 75  2 3
     80405041102  4  2 75  2 3
     80604091102  4  2 75  2 3
     80701171102  4  2 75  2 3
     80704041102  4  2 75  2 6
     81305051102  4  2 75  2 2
     81405080202  4  2 75  2 4
     82001041102  5  2 69  2 3
     82002011102  4  2 75  2 1
     82608030202  5  2 69  2 .
     83202091102  4  2 75  2 4
    end
    label values SPRO10 SPRO10
    label def SPRO10 69 "Other nonres 69", modify
    label def SPRO10 75 "Died 75", modify
    Last edited by Eve Alexander; 15 Jan 2023, 22:01.

  • #2
    Im using STATA 13.

    Comment


    • #3
      Reposted with an expanded description at

      https://www.statalist.org/forums/for...ing-year-match

      Comment

      Working...
      X