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]

Re: st: RE: Creating a table with sample restriction specifics in headers


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: RE: Creating a table with sample restriction specifics in headers
Date   Mon, 20 May 2013 20:13:32 +0100

No mystery here. The keywords are extended macro function and

. help extended_fcn

takes you to documentation. Alternatively, a small twist on David's code gives

local mylabel "`: variable label make'"

Nick
[email protected]


On 20 May 2013 20:01, Stephen Cranney <[email protected]> wrote:

> Thanks David; I guess I'm wondering how to turn that label into a
> macro. Once I do that I can re-label the dependent variable in each
> loop, then the sample limitation will appear at the top of each table
> naturally. So I guess the question is, how do I use the display (or
> any other command) to turn the label into a local (or global) macro
> that I can refer to later on?

On Mon, May 20, 2013 at 1:22 PM, Radwin, David <[email protected]> wrote:

>> I'm scarcely familiar with -estout- (Ben Jann, SSC) and -estimates
>> store-, but as for the first part of your question, you can use an
>> extended macro function to refer to a variable label. For example:
>>
>> . sysuse auto
>> . display "`: variable label make'"
>>
>> It's hard to tell from your example, but I think you actually want a
>> value label for each value of the numeric variable V7. There is a
>> different syntax for that:
>>
>> . display "`: label (foreign) 1'"
>>
>> In your code it might be:
>>
>> . somecommand "`: label (V7) `l''"
>>
>> That is the number 1 in the second to last example and the letter l in
>> the last example.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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