This is what I currently have:
id_1 id_2 x1 x2
1 2 10 100000
1 4 15 100000
1 17 3 100000
2 3 2 150000
2 4 20 150000
2 10 6 150000
2 11 9 150000
I am wondering if it is possible to count observations given two IDs.
I would like to create the variable "count" below
id_1 id_2 x1 x2 count
1 2 10 100000 1
1 4 15 100000 2
1 17 3 100000 3
2 3 2 150000 1
2 4 20 150000 2
2 10 6 150000 3
2 11 9 150000 4
Thank you
id_1 id_2 x1 x2
1 2 10 100000
1 4 15 100000
1 17 3 100000
2 3 2 150000
2 4 20 150000
2 10 6 150000
2 11 9 150000
I am wondering if it is possible to count observations given two IDs.
I would like to create the variable "count" below
id_1 id_2 x1 x2 count
1 2 10 100000 1
1 4 15 100000 2
1 17 3 100000 3
2 3 2 150000 1
2 4 20 150000 2
2 10 6 150000 3
2 11 9 150000 4
Thank you
Comment