Hi,
I would like to count the frequency of an observation within a variable.
Thus, I would like to create a variable "a" which refers to variable"x" in the following pattern:
variable "x" 1 1 1 2 2 2 2 2 6 7 7 7 8 8
variable "a" 3 3 3 5 5 5 5 5 1 3 3 3 2 2
Basically "a" counts how many times "x" is 1, how many times "x" equals 2 etc.
Does someone know how to do that?
I was unable to find anything in that direction..
Thanks,
Xueqian
I would like to count the frequency of an observation within a variable.
Thus, I would like to create a variable "a" which refers to variable"x" in the following pattern:
variable "x" 1 1 1 2 2 2 2 2 6 7 7 7 8 8
variable "a" 3 3 3 5 5 5 5 5 1 3 3 3 2 2
Basically "a" counts how many times "x" is 1, how many times "x" equals 2 etc.
Does someone know how to do that?
I was unable to find anything in that direction..
Thanks,
Xueqian