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
What estimation methods can endogenicity, heteroskedasticity, autocorrelation and fixed effects be solved without using GMM?Hello netizens of Stata forum. I have a panel of 13 countries and 8 years. I tried with the GMM but …
Fama&MacBeth: xtfmb function. Time-fixed effectsHello statalisters, My case is that of an unbalanced panel data composed by 25,714 companies ("cusi…
Keeping mutliple observationsHello, I am currently working with a complete dataset with all firms in a country. However, I only …
Constraint function in optimize()Hello, I'm currently facing the following problem: I'm trying to minimize the variance of a portfol…
Arellano & BondHi there, I am looking for some advice on using the xtabond command. In an effort to study the rel…
Subscribe to:
Post Comments (Atom)
0 Response to Data construction and management
Post a Comment