I currently have the dataset:
Time Var1 Var2 Cat
1 14 16 1
2 16 98 1
4 52 68 1
7 17 12 1
1 57 58 2
3 45 35 2
4 33 12 2
7 77 1 2
And wish to be able to create continuous time variable for each of category, like so:
Time Var1 Var2 Cat
1 14 16 1
2 16 98 1
3 NA NA 1
4 52 68 1
5 NA NA 1
6 NA NA 1
7 17 12 1
1 57 58 2
2 NA NA 2
3 45 35 2
4 33 12 2
5 NA NA 2
6 NA NA 2
7 77 1 2
I am struggling to be able to impute all the data rows for each category.
All help is greatly appreciated.