Statalist


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

Re: st: AW: creating and calling local macros in do-files


From   S Aneeqa Aqeel <saaqeel@umich.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: AW: creating and calling local macros in do-files
Date   Tue, 04 Aug 2009 13:13:26 -0400

Thank you, that certainly helped clarify what I was doing incorrectly (trying to break up a do-file and run it piecemeal).

Regards,

Aneeqa

Quoting Martin Weiss <martin.weiss1@gmx.de>:


<>


First of all, from your description it is not necessarily the case that you
need -local-s at all. If you do, a do-file counts as one session, and all
-local-s are lost upon its termination.

I would suggest you post example data and what you want to achieve, and the
-local- thing will be rendered redundant...



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von S Aneeqa Aqeel
Gesendet: Dienstag, 4. August 2009 18:10
An: statalist@hsphsun2.harvard.edu
Betreff: st: creating and calling local macros in do-files

I am using STATA10 on a Windows 64-bit system.
I have looked up past FAQs on macros as well as the STATA user guide,
etc.  I have also tried my code on a different computer, but get the
same result. So I'm posting my question to the Statalist and would be
grateful for any light you can shed on this matter.

I am using panel data and creating quarterly dummies for each year
(2000-2009).
I then create local macros, one for each year, collecting the
quarterly dummies by year.

I am finding that STATA does not create more than one local macro if I
try to create several inside a do-file.  Consequently, when  the
do-file then tries to execute a regression, based on the local macros
created, the regression output shows no results at all for the
variables inside the macros which I am calling in the regression.

If I create each macro in the command window, one by one, and then run
the regression by typing it out in the command window, I get results
for each of the variables included.

Similarly, if I try to see what variables are included in the macro
(by using "summarize"), it doesn't work if the macro was one of
several created in the do-file, but will work if I created it directly
from the command window.

Can you tell me why a macro might not run from inside the do-file? Is
there an upper limit to the number of local macros one can create and
call at any time?

I can provide log files and my code if it would help.

Many thanks and regards,

Aneeqa

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



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index