Hello,
I have data which looks similar to this:
In this sample of my data there is only one value for isic3_3d, but in my data I have many values for this variable, here it only ever equals 151. I would like to create a variable which indicates the number of times the isic3_3d observation takes on the value 1 for class, when doing a simple count it would look like this:
Whilst it's not illustrated here, I have many values of isic3_3d so I would like to create a variable which calculates the number of times class==1 by the variable isic3_3d. So for example, for all entries with isic3_3d ==151 this variable would take on the same value and it would take the value of "count if isic3_3d==151 & class==1". Then for all entries where isic3_3d equals say 152, this variable would take on the value of "count if isic3_3d==152 & class==1".
Please let me know how I can implement this.
Thanks,
Jad
I have data which looks similar to this:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float(isic3_3d class) 151 1 151 2 151 2 151 1 151 2 151 2 151 1 151 2 151 2 151 1 151 2 151 2 151 1 151 1 151 2 151 2 151 1 151 1 151 2 151 2 151 2 151 1 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 1 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 1 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 151 2 end label values class x label def x 1 "Intermediate", modify label def x 2 "Consumption", modify
Code:
count if isic3_3d==151 & class==1
Please let me know how I can implement this.
Thanks,
Jad

Comment