I am working with a set of dta
files representing surveys from different years.
Conveniently, each year uses different values for the country
variable, so I am trying to set the country
value labels for each year to match. I am having trouble comparing value labels though.
So far, I have come up with the following code:
replace country=1 if countryO=="Japan"
replace country=2 if countryO=="South Korea" | countryO=="Korea"
replace country=3 if countryO=="China"
replace country=4 if countryO=="Malaysia"
However, this doesn't work because "Japan" is the value label, not the actual value.
How do I tell Stata that I am comparing the value label?
if
here is theif
qualifier; theif
command is different. Note that if you look in the index to the User's Guide, there are just two entries on value labels, and 13.10 contains the detail you need. Compare my earlier remarks on Googling when you have the documentation right there. – Tipton