Wednesday, June 24, 2009

Naming and Labelling in Stata

Two very useful programmes are labutil and renvars. Examples of what can be done with these are reversing the labelling on a variable with a single command (e.g. 1=Excellent to 5=Excellent), and renaming common parts of multiple variables at the same time.


Kevin Denny said...

I am not familiar with these. I use a Stata command renpfix

Say you create a set of country dummies
xi i.countryid

Stata generates a set of nasty sounding dummies
_Icountryid_1 etc

renpfix _Icountryid_ country

will rename , replacing the "stub" "_Icountryid_" with "country"

Martin Ryan said...

Thanks for mentioning this one Kevin.