I'm having difficulties with some recoding (filling in empty cells in R or SPSS)
I'm working with a long format data-set (in order to run a multilevel model) where each respondent (ID-variable) has three rows, so three times the same ID number below each other (for three different momemts in time).
The problem is that for a second variable (ancestry of respondent) only the first row has a value but the two second rows for each respondent misses that (same) value (0/1). Can any one help? I'm only used to recoding within the same row... below a the data format.
ID      Ancestry    
1003    1
1003    .
1003    .
1004    0
1004    .
1004    .
1005    1
1005    .
1005    .
 
     
     
     
     
     
    