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]
st: Fwd: Retrieving macros defined inside for loop
From
Laura Grant <[email protected]>
To
[email protected]
Subject
st: Fwd: Retrieving macros defined inside for loop
Date
Tue, 19 Nov 2013 15:43:20 -0600
Simple question. I want to retrieve macros once outside the loop that
are defined inside the loop.
I do -regress- , then I have a loop to perform -lincom- t-tests
comparing stored coefs
reg y star0 star1 star2 star3 star4 star5 star6 star7 x1 x2 x3
forval i = 0/6 {
local j = `i'+1
lincom star`j' - star`i'
local c_`j'= r(estimate)
local se_`j'=r(se)
display `c_1'
}
-display- works inside the loop but I cannot retrieve the c_j's and
se_j's outside the loop. And I would like to output them to a
table/text.
Thanks for your help, Laura
*
* 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/