I have a data with two factors: industry and time.
industry time
1 1990
1 1990
2 1990
2 1991
3 1990
3 1990
I want to create a factor A
that put observations with the same industry and time into each levels:
industry time A
1 1990 1
1 1990 1
2 1990 2
2 1991 3
3 1990 4
3 1990 4