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: Outreg2 error "matrix __000009 not found"
From
Redacted <redacted>
To
[email protected]
Subject
st: Outreg2 error "matrix __000009 not found"
Date
Thu, 14 Feb 2013 00:20:58 +0100
Dear Stata listers,
I'm having trouble with what should actually be a relatively simple piece of code. With the loop below I was planning to store AIC and BIC values to an outreg table. The code works perfectly fine, until the "noconstant" option is added to the regression (line 3).
----------
local p dy0 //get AIC BIC
forvalues d=1/7 {
quietly regress `p', noconstant
estat ic
matrix OUT = r(S) //store matrix
local AIC = OUT[1,5] //store AIC
local BIC = OUT[1,6] //store BIC
outreg2 using temp.tex, append tex(fragment) ///
addstat(AIC, `AIC', BIC, `BIC')
local p = "`p' dy`d'"
}
! mv "./temp.tex" "./2ay.tex" /*rename temp.tex to 2a.tex
may not work outside unix
overwrites existing 2a.tex
*/
! rm -r "./temp.txt"
----------
With "[...], noconstant" specified, the code returns the error "matrix __000009 not found". The same happens when running all the lines individually. The code, however, works without issues when the noconstant option is omitted.
I am not sure whether this is a bug or if I am overlooking something. I really hope someone can find what's the problem here.
Thanks and cheers,
<Redacted>
*
* 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/