Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: converting variable labels to proper case with apostrophes


From   "Dimitriy V. Masterov" <dvmaster@gmail.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   st: converting variable labels to proper case with apostrophes
Date   Fri, 21 Jul 2006 17:40:43 -0400

I am trying to convert my variable labels to proper case, so that
instead of "government office region" I have "Government Office
Region". I used this code:
	foreach var of varlist _all {;
		set trace on;
		lab var `var' "`=proper("`:var label `var''")'";
	};

but it runs into problem when there are apostrophes in the label. I
checked out the labutils suite, but I don't think there's a solution
there.

Any suggestions?

Dimitriy Masterov
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index