Code:
. tab nation2, m nation2 | Freq. Percent Cum. ------------+----------------------------------- | 51,292 16.10 16.10 OTHER | 212,447 66.68 82.78 SE | 54,854 17.22 100.00 ------------+----------------------------------- Total | 318,593 100.00
Code:
encode nation2, gen(nation_encoded)
Code:
. tab nation_encoded, nolab m nation_enco | ded | Freq. Percent Cum. ------------+----------------------------------- 1 | 212,447 66.68 66.68 2 | 54,854 17.22 83.90 . | 51,292 16.10 100.00 ------------+----------------------------------- Total | 318,593 100.00
Now I want to count the instances of nation_encoded=="OTHER".
If I do
Code:
. count if nation_encoded=="OTHER" type mismatch
Code:
. count if nation_encoded==1 212,447
Is there something like
Code:
count if nation_encoded==nation_encoded.labels.OTHER
0 Response to Retrieve the numeric value of a label
Post a Comment