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   David Kantor <[email protected]>
To   [email protected]
Subject   Re: st: outsheeting tempvar names
Date   Wed, 18 Sep 2013 11:17:58 -0400

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/


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