My dataset looks as follows:
Because respondent 1234 has not responded to wave 3, the age variable is missing. I am interested in which wave individual 1234 has become eligible for a program (by turning 50). Hence, I would like to impute these values. I am considering using a for-loop, but am not sure if this operation is possible in a long format of the data.
ID | wave | Age | male |
1234 | 1 | 47 | 1 |
1234 | 2 | 49 | 1 |
1234 | 3 | . | 1 |
1234 | 4 | 53 | 1 |
1234 | 5 | 55 | 1 |
Comment