Hi
I have some US census data including information about individuals; where they live (state), housing characteristics, age, income etc.
Currently there is one observation for each individual, I want to add 50 observations to each individual (so that there is 51 per individual), 1 observation per individual for every US state. I want these new observations to go directly under the first observation for each person.
All the variables should be duplicates of the original observation but the variable that indicates the state (which should go from 1-51). And then I need a 'choice variable' that indicates where the individual is actually living (1 if individual lives in that state, 0 otherwise).
I would be very grateful for any advice, I have tried to look at commands like expand and insobs but not really getting anywhere.
Kind regards
Stella
I have some US census data including information about individuals; where they live (state), housing characteristics, age, income etc.
Currently there is one observation for each individual, I want to add 50 observations to each individual (so that there is 51 per individual), 1 observation per individual for every US state. I want these new observations to go directly under the first observation for each person.
All the variables should be duplicates of the original observation but the variable that indicates the state (which should go from 1-51). And then I need a 'choice variable' that indicates where the individual is actually living (1 if individual lives in that state, 0 otherwise).
I would be very grateful for any advice, I have tried to look at commands like expand and insobs but not really getting anywhere.
Kind regards
Stella
Comment