Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Martin Weiss" <martin.weiss1@gmx.de> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | AW: st: AW: AW: Display Variable Labels |
Date | Thu, 27 May 2010 18:33:42 +0200 |
<> As Nick points out in the help file to his -ssc d copydesc-, there seems to be a undocumented utility in official Stata for this purpose as well: ************* sysuse auto, clear d mpg weight _crcslbl weight mpg d mpg weight ************* HTH Martin -----Ursprüngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Martin Weiss Gesendet: Donnerstag, 27. Mai 2010 18:24 An: statalist@hsphsun2.harvard.edu Betreff: AW: st: AW: AW: Display Variable Labels <> " What if I now want to copy the variable label from of pwvssn to a variable called zpwvssn?" Let`s give "weight" the -var label- of "mpg": ************* sysuse auto, clear d mpg weight la var weight "`: var l mpg'" d mpg weight ************* You can also do things like -clonevar- which copies everything else as well. HTH Martin -----Ursprüngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Raphael Fraser Gesendet: Donnerstag, 27. Mai 2010 18:21 An: statalist@hsphsun2.harvard.edu Betreff: Re: st: AW: AW: Display Variable Labels Thank you. pwvssn is just one of 52 variables. What if I now want to copy the variable label from of pwvssn to a variable called zpwvssn? Raphael On Thu, May 27, 2010 at 11:03 AM, Martin Weiss <martin.weiss1@gmx.de> wrote: > > <> > > > BTW, Raphael, what kind of a -varlist- is "pwvssn" in your example? Does it > expand to more than one variable? > > > > HTH > Martin > > > -----Ursprüngliche Nachricht----- > Von: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Martin Weiss > Gesendet: Donnerstag, 27. Mai 2010 17:57 > An: statalist@hsphsun2.harvard.edu > Betreff: st: AW: Display Variable Labels > > > <> > > See -help extended_fcn-: > > > ************* > sysuse auto, clear > foreach var of varlist _all{ > di in r "`: var la `var''" > } > ************* > > > > HTH > Martin > > > -----Ursprüngliche Nachricht----- > Von: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Raphael Fraser > Gesendet: Donnerstag, 27. Mai 2010 17:53 > An: statalist@hsphsun2.harvard.edu > Betreff: st: Display Variable Labels > > 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? > > Thanks, > Raphael > * > * 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/ > > > * > * 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/ > > > * > * 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/ > * * 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/ * * 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/ * * 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/