Hi all,
I have 55 datasets with the same set of 60 variables. Most of them are categorical. Some datasets have small numbers in some of the categories for some of the variables, and I'm trying to find a way to recode based on the frequency in each category (e.g. if less than 10). So with the example below to select categories 1 and 2, and recode rep78 missing for those values. The problem is that it's not always the same categories in each dataset that have small numbers. Any ideas on how to do this?
Thanks,
Sonia
I have 55 datasets with the same set of 60 variables. Most of them are categorical. Some datasets have small numbers in some of the categories for some of the variables, and I'm trying to find a way to recode based on the frequency in each category (e.g. if less than 10). So with the example below to select categories 1 and 2, and recode rep78 missing for those values. The problem is that it's not always the same categories in each dataset that have small numbers. Any ideas on how to do this?
Thanks,
Sonia
Code:
sysuse auto, clear tab rep78 Repair | Record 1978 | Freq. Percent Cum. ------------+----------------------------------- 1 | 2 2.90 2.90 2 | 8 11.59 14.49 3 | 30 43.48 57.97 4 | 18 26.09 84.06 5 | 11 15.94 100.00 ------------+----------------------------------- Total | 69 100.00
Comment