Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: RE: local macro

From   "Nick Cox" <>
To   <>
Subject   st: RE: local macro
Date   Fri, 9 Apr 2010 16:13:24 +0100

Note that "local" means precisely that. Local macros are local to the
program, do-file, do-file editor session, or interactive session in
which they are defined and are not visible outside. 

Thus in fact your do-file will have created these macros; it is merely
that they will not be visible within your interactive session. 

There are various solutions to this. One is to write a program. Another
is to use globals. Yet another is to use -c_local-. In your case the
best will be to avoid using locals altogether and pick up the e()
results in your interactive session. 

The last has been called out "cutting out the middle macro", as the
macro serves no real purpose in code like this. 


Mary E. Mackesy-Amiti

I am using Stata 10.1.  When I run the following commands from the 
command line I have no problem, but when I run them from a do file, the 
local macros are not created.  What am I missing?

Mary Ellen

gllamm timeinj  fup6 , i(partid) nrf(2) eqs(cons slope2) nip(2) ip(f) 
matrix a=e(b)
local ll= e(ll)
local k=e(k)

gllamm timeinj fup6 , i(partid) nrf(2) eqs(cons slope2) nip(3) ip(f) 
from(a) ///
    fam(poi) gateaux(-10 10 30) lf0(`k' `ll')

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index