Panel data: Identify change in id of respondent for imputation
Dear statalist community,
I have a panel of around 12,000 individuals and four rounds, where the individuals or their parents answer the questionnaires. I would like to use one of the questions answered by the parents. Ideally, I would like to have the same parent answer the same questions in all rounds. However, it often occurs that, say the mother responded in 3 rounds and the father in one round or vice versa. Therefore, I would like to impute the data for the round where a different parent responded. Yet, I don’t know how to exactly identify the change in the id123( id of respondent for a set of relevant questions) to identify the observation to be imputed. I also have the momid and dadid. It's also worth mentioning that sometimes that the data is available for less than 4 rounds which complicate things a little bit. Also, id123 for the parents doesn't always take the same value.
Example of the data
childid round id123
0001 1 1
0001 2 1
0001 3 2
0001 4 2
0002 1 2
0002 2 3
0002 3 2
Until now, I have done the following:
by childid id123, sort: gen repidvar3= _N if id123==momid
by childid id123, sort: gen repidvar3_fa= _N if id123==dadid
or
But that doesn't exactly identify what I want or does it partially. Is there a better way of doing this?
Thanks a lot for your answer,
Michelle Argueta
0 Response to Panel data: Identify change in id of respondent for imputation
Post a Comment