Aloha,
I am using the NLSY97 and doing a project where I need to link siblings within the data. I have it so my observations are as follows:
ID age sibid year older hhid
1 x_1 2 1997 0 1
1 x_2 2 1998 0 1
2 y_1 1 1997 1 1
2 y_2 1 1998 1 1
etc.
The "older" variable simply indicates if that sibling is the oldest within the household.
I would like to add another variable "age_older" so that I have the age of the older sibling in the same person-year observation as the younger sibling. I imagine the data to look as follows:
ID age sibid age_older year older hhid
1 x_1 2 y_1 1997 0 1
1 x_2 2 y_2 1998 0 1
2 y_1 1 0__ 1997 1 1
2 y_2 1 0__ 1998 1 1
etc.
Two questions: how do I create a command to do this? Second: should the observations for "age_older" of the older sibling (seen above in the latter two person-year observations) be 0 or "." for missing? It really is an "N/A".
I will be using this in a regression discontinuity design, with the cutoff based on the age of the older sibling.
Thank you!
Related Posts with Linking person-year records across different people (using NLSY97)
REGHDFE Coefplot graphing mistakeI'm having a little trouble graphing coefplot. My regression is using reghdfe command and I'm simply…
Compare variable in two stata files and listI have two datasets and I want to make sure that the same IDnumber has not been recorded twice in th…
Compatibility of Stata 16 and Stata 17 outputs?At my academic workplace I have Stata 16 MP (16.0, not updated -- long story, endless fights with th…
Interpolation Method: panel data setHello, I show you an example of the dataset that I have: Code: * Example generated by -dataex-. …
Remove estimated parameters from Stata result windowHi All, just a quick question. I am estimating a model containing a lot of dummies, which I use as …
Subscribe to:
Post Comments (Atom)
0 Response to Linking person-year records across different people (using NLSY97)
Post a Comment