Hi, I am trying to calculate the number of times a specific value (in this case a string) occurs in a variable, and place it in a new variable.
Code:
gen occurence_id = .
In the end I would like it to be like this:
id occurence_id
12345678 4
45624845 1
12345678 4
51564215 3
56435158 1
12345678 4
46548675 1
51564215 3
12345678 4
51564215 3
Any ideas on how I can do this?


Kind regards,
Petar