Statalist


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

st: creating and calling local macros in do-files


From   S Aneeqa Aqeel <[email protected]>
To   [email protected]
Subject   st: creating and calling local macros in do-files
Date   Tue, 04 Aug 2009 12:09:55 -0400

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/



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