Hi I need help with the following :
family ID myear edu
A A1 1981 9
A A2 1984 13
A A3 1985 18
A A4 1987 10
A A5 1990 5
myear is the year of marriage.
I need to create an unbalanced (every ID is repeated from myear till 1990 ) panel data with a rolling sum variable at the ID-year level.
For A2 in 1985, he is exposed to the 9 years education of A1 (not his own). This continues till A3 marries into family in 1985, and it changes to 27 till 1987 when A4 marries. It is 37 for 1987-88. It changes to 42 in 1990 with A5 marrying.
(Similarly for every individual)
The finaldata should look like this: (numerator is the variable I want and described above)
Any idea how I can go about this? I have not understood how to tell stata that it is the sane household but you take women after my mnarriage, and make it a sum without including myself.
family ID myear edu
A A1 1981 9
A A2 1984 13
A A3 1985 18
A A4 1987 10
A A5 1990 5
myear is the year of marriage.
I need to create an unbalanced (every ID is repeated from myear till 1990 ) panel data with a rolling sum variable at the ID-year level.
For A2 in 1985, he is exposed to the 9 years education of A1 (not his own). This continues till A3 marries into family in 1985, and it changes to 27 till 1987 when A4 marries. It is 37 for 1987-88. It changes to 42 in 1990 with A5 marrying.
(Similarly for every individual)
The finaldata should look like this: (numerator is the variable I want and described above)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment