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: outsheeting tempvar names


From   adrien bouguen <[email protected]>
To   [email protected]
Subject   Re: st: outsheeting tempvar names
Date   Thu, 19 Sep 2013 11:59:54 +0200

Thanks for your answers.

I use stata 11 unfortunately ... sorry for forgetting to mention it upfront.

Maybe tempvar are not idea but it would solve my problem. I would like
to include this outsheet command into a program that runs some
analysis. Creating "real" variable would means either dropping
variables with the same name at the beginning of my program ( not sure
I want to do that) or dropping them at the end of my command. The
problem with the latter is that whenever program stops (for some
reasons), I stay with my column name variables in my database. And I
don't like that.

Any further ideas?

Best




2013/9/18 David Kantor <[email protected]>:
> At 10:52 AM 9/18/2013, Adrien Bouguen wrote:
>>
>> Dear statalisters,
>>
>> I would like to extract in a excel sheet few temporary variables using
>> outsheet. My problem is when I do for instance:
>>
>> outsheet `var1' using "path"
>>
>> the variable name in the excel sheet is not var1 but something like
>> __00000. It is annoying because I'd like to use this as a regression
>> table with var1 as column name.
>>
>> Any idea how to solve this?
>>
>> Thank you so much for your replies
>>
>> Best
>> Adrien Bouguen
>
> [...]
>
> Don't use temporary variables in this context. Or temporarily rename them to
> real names.
> Note that, as a tempvar, var1 is a macro whose content, `var1', is assigned
> by Stata to a name of its choosing -- such as __00000.
> var1 is not the variable name; `var1' (the content) is the name.
> It's a variable, but it gets dropped when the local scope is exited.
> HTH
> --David
>
>
> *
> *   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/



-- 
Adrien Bouguen
Ecole d'économie de Paris - J-PAL
66 bis avenue Jean Moulin
75014 Paris
tel: +33 (0)1 71 19 40 83
port: +33 (0)6 69 34 12 02

*
*   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