Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Display Variable Labels


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Display Variable Labels
Date   Thu, 27 May 2010 17:00:11 +0100

This was discussed earlier today in 

http://www.stata.com/statalist/archive/2010-05/msg01431.html

But note that your code is a loop around a varlist with a single
variable. So it reduces to 

display _newline(3) _column(4) as text "`: var label pwvssn'"
ta diag, sum(pwvssn)

A more general recipe runs like this 

foreach v of varlist <whatever> { 

	di `"`: var label `v''"' 

}

The compound double quotes `" "' are for any " inside the variable
label. 

Nick 
[email protected] 

Raphael Fraser

foreach var of varlist pwvssn {
        ...
	display _newline(3) _column(4) as text "`var'"
	ta diag, sum(`var')
	...
	}


How can I display the variable label rather than the variable name?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index