Hi, I'm having trouble creating a new variable. Imagine this fictive dataset: ID X Y Z 1 23 3 1 2 12 2 0 3 10 3 0 1 80 6 1 2 09 2 0 1 78 7 1 4 14 6 0 5 67 9 1 6 12 5 1 1 89 4 0 I want to create a new variable named 'count' that counts how many times the same ID number appears. Besides that, the new variable 'count' should only count those ID numbers with the variable Z = 1. So in this dataset the variable 'Count' would look like: ID X Y Z COUNT 1 23 3 1 3 2 12 2 0 0 3 10 3 0 0 1 80 6 1 3 2 09 2 0 0 1 78 7 1 3 4 14 6 0 0 5 67 9 1 1 6 12 5 1 1 1 89 4 0 3 Thanks!
... View more