I am working with child data and having difficulties trying to create a variable that contains birth order and whether the child has older brothers or sisters with respect to the child id = 0.
Something similar with this code here,
0=child is firstborn
1=child is secondborn and has an older brother
2=child is secondborn and has an older sister
3=child is thirdborn or higher birth order and has at least one older brother
4=child is thirdborn or higher birth order and has no older brothers.
I have this sample as an example data
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str8 childid byte(id age sex relate) "010001" 0 4 1 0 "010001" 1 31 1 1 "010001" 2 23 2 1 "010001" 3 1 2 7 "010002" 0 5 1 0 "010002" 1 45 1 1 "010002" 2 36 2 1 "010003" 0 4 1 0 "010003" 2 34 1 1 "010003" 3 26 2 1 "010003" 4 3 2 7 "010004" 0 5 2 0 "010004" 1 39 1 1 "010004" 2 31 2 1 "010004" 3 10 2 7 "010004" 4 9 2 7 "010005" 0 5 2 0 "010005" 3 42 1 1 "010005" 4 31 2 1 "010006" 0 5 1 0 end label values sex memsex label def memsex 1 "male", modify label def memsex 2 "female", modify label values relate relate label def relate 0 "yl child", modify label def relate 1 "biological parent", modify label def relate 7 "brother/sister (both parents the same)", modify
Thank you in advance
Related Posts with Data construction and management
combine csv filesHi all, I have 1460 file.csv, each one of these files provide information on price, brand and fuel o…
variable does not uniquely identify observations in the using dataHi I'm working with two data bases but there they don't have the same observations. The first one be…
Multiple Legends and Reducing Variables with Four Panes in CoefplotHey there Stata users, I am trying to plot the results for a select number of independent variables…
calculating yield to maturity for coupon bondsHi, I do a research on bond market. Searching on the net, I could not find any stata cammand which …
Replacing values of one variable by specific value in anotherHi All, I have data that resembles the following: Code: * Example generated by -dataex-. To inst…
Subscribe to:
Post Comments (Atom)
0 Response to Data construction and management
Post a Comment