Automate recoding of "Other specify" responses in survey data.
net install recode_nrep, from("https://raw.githubusercontent.com/ashikpydev/recode_nrep/main/") replace
help recode_nreprecode_nrep mainvar splitvar othvar
mainvar: Primary variable (g1b4)
splitvar: "Other" dummy (g1b4_97)
othvar: Text variable (g1b4oth)Before:
g1b4_97 Other | 21 9.86%
g1b4oth:
He Plays | 7
he walks | 14
Command:
recode_nrep g1b4 g1b4_97 g1b4othAfter:
g1b4_97 Other | 0 0.00%
g1b4_1001 | 7 3.29% // He Plays
g1b4_1002 | 14 6.57% // he walks
- Creates new variables for frequent responses
- Starts new codes at 1001
- Blanks processed text responses
- Requires ≥ 10% response frequency
Apache 2.0 © 2025 Ashiqur Rahman Rony
Email: ashiqurrahman.stat@gmail.com