Hi guys, I have a group variable (GROUPS8) and I want to generate two new variables from it- Caste and Religion. For religion, I want to use the first 5 to make a group Hindu taking value 1, Muslim taking value 2, and others taking value 3.

HH3 1.13-15 |
Caste/relig |
ion 8cats | Freq. Percent Cum.
------------+-----------------------------------
Brahmin-1 | 12,108 5.61 5.61
High caste-2 | 35,531 16.47 22.08
OBC-3 | 72,900 33.79 55.87
Dalit-4 | 43,270 20.06 75.92
Adivasi-5 | 17,405 8.07 83.99
Muslim-6 | 27,661 12.82 96.81
Sikh, Jain-7 | 3,672 1.70 98.51
Christian-8 | 3,207 1.49 100.00
------------+-----------------------------------
Total | 215,754 100.00