Hello,
I wish to generate mother's matriculation literacy dummy (edu_matri) and illterate dummy (illterate) from the mothers household rooster id RO9 for each child ( CH_ID ). How do I do that?
Im using Stata14 MP.


Code:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double IDPERSON int(HHID RO9) float(CH_ID edu_matri illterate)
19010401303 1  1 19010402304 0 1
 8150401104 1  1  8150401024 0 0
23210501102 1  .           . 0 1
24070701002 1  .           . 0 0
 3170301005 1  1  3170300928 0 1
 1130801002 1  .           . 1 0
 3030801002 1  .           . 0 1
 2050401102 1  .           . 0 0
27210701002 1  .           . 1 0
21290201006 1  1 2.12902e+10 0 1
27180301403 1  1 2.71803e+10 0 1
33150101103 1  1 3.31501e+10 0 0
 2010501002 1  .           . 0 1
21150901102 1  .           . 0 0
24071501002 1  .           . 1 0
23230401102 1  .           . 0 1
 8030101001 1  .           . 1 0
10020401102 1  .           . 0 1
 3100101005 1  3  3100101120 0 1
 8260401102 1  .           . 0 1
 2050501103 1  .           . 0 1
33290101106 1  4 3.32901e+10 0 1
 9680401202 1  .           . 0 1
24072201005 1  1 2.40722e+10 0 0
 8151101004 1  1  8151100928 0 1
23420401002 1 69           . 0 1
28220901101 1  .           . 0 1
 6091001003 1  1  6091000832 0 0
 9670501004 1  .           . 1 0
27300301104 1  .           . 0 1
 8130301102 1  .           . 0 1
 5050401002 1  .           . 1 0
 1050601002 1  .           . 0 1
 2040301302 1  .           . 0 0
 7100901002 1  .           . 0 1
 8030301002 1  .           . 0 1
 2040601002 1  .           . 0 1
29160401003 1  1 2.91604e+10 0 1
 9010201102 1  .           . 0 1
29121301003 1  1 2.91213e+10 0 1
 6190201106 1  1  6190201344 0 0
 2040901002 1  .           . 1 0
 3110601007 1  .  3110600960 0 0
 3070701009 1  7  3070701056 0 1
27020501006 1  .           . 1 0
23160201105 1  1 2.31602e+10 0 1
32020401006 1 75           . 0 0
 8260801002 1  .           . 1 0
19060301108 1  1 19060301824 0 1
27200401202 1  .           . 0 1
33130201002 1  .           . 0 0
21290401006 1 75 2.12904e+10 0 1
29190201002 1  .           . 0 1
29050401104 1  1 2.90504e+10 0 0
10020801103 1  .           . 0 1
 6180801004 1  .           . 1 0
18171301002 1  .           . 0 0
29253601104 1 75 2.92536e+10 0 0
32051101012 1  .           . 0 0
29070501004 1  1 2.90705e+10 0 1
21060401109 1  .           . 0 0
27070501104 1  2 2.70705e+10 0 1
 9620301004 1  .           . 0 1
19040201005 1  .           . 1 0
23090201303 1  1 2.30902e+10 0 1
 8040201102 1  .           . 0 1
33230601103 1 75 3.32306e+10 0 0
27180301202 1  .           . 0 0
11040601004 1  .           . 0 0
10161101302 1  .           . 0 1
 6100101106 1  3  6100101120 0 1
33300901004 1  .           . 0 0
19090801009 1  7 1.90908e+10 0 1
 3070201104 1  .           . 0 1
 9590101008 1  .           . 0 0
23120201111 1  .           . 0 1
 2080101102 1  .           . 0 0
29110201003 1  1 2.91102e+10 0 1
 2060601004 1  .           . 0 0
21210401104 1  1 2.12104e+10 0 1
23200301105 1  3 2.32003e+10 0 1
21050401105 1  1 2.10504e+10 0 0
 9540201001 1  .           . 0 1
21081001004 1  1  2.1081e+10 0 0
29193601106 1  3 2.91936e+10 0 0
21210101304 1  1 2.12101e+10 0 0
28040501003 1  1 2.80405e+10 0 0
24160101102 1  .           . 0 1
23090201302 1  .           . 0 1
23260601002 1  .           . 0 0
 9050801002 1  .           . 0 1
19070101105 1  .           . 0 0
19171101002 1  .           . 1 0
19080901402 1  .           . 0 1
 8150901002 1 75           . 1 0
 2100101104 1  .           . 0 0
21260101008 1  1 2.12601e+10 0 1
23440501105 1  1 2.34405e+10 0 1
19020301102 1  .           . 0 1
 2100501103 1  .           . 0 1
end
label values RO9 RO9
label def RO9 69 "Other nonres 69", modify
label def RO9 75 "Died 75", modify