I'd like to generate a set of dummy variables based on one categorical variable, in this case a variable named 'country.'
qui tab country, gen(cntry)
This has created such a set of dummy variables, however, each of them is labeled 'country==USA' etc. How do I remove the old variable name and the equal signs from the variable labels of the new set of dummy variables? Like this:
foreach var of varlist cntry* {
local lab `: var label `var''
local lab `: di subinstr("`lab'", "country==", "", 1)'
label var `var' "`lab'"
}