Hi,
I want to create a count variable. I have the following dataset:
ID GPS Open Store
1 4321 Y 1
1 3421 Y 2
1 2321 N 1
2 1235 Y 4
2 1242 N 2
3 1235 N 2
The new dataset should look like:
ID GPS Open Store Count
1 4321 Y 1 3
1 3421 Y 2 3
1 2321 N 1 3
2 1235 Y 4 2
2 1242 N 2 2
3 1235 N 2 1
So the new variable 'count' counts the number of observations with the same ID.
Thanks!