I have a wide dataset (could transpose to long, then be re-transposed if necessary) that has various outcomes at 15 time points. If missing, it will have "NA." I want to impute the first missing "NA" right after an observation. See example: HAVE: id time1 time2 time3 time4 time5 A 1 NA 2 NA NA B 2 3 NA 3 NA C 2 NA NA NA 4 D 1 2 2 NA NA WANT: id time1 time2 time3 time4 time5 A 1 1 2 2 NA B 2 3 3 3 3 C 2 2 NA NA 4 D 1 2 2 2 NA Any help would be greatly appreciated!
... View more