[email protected] reported a bug when using -test- after -regress- in
which the -regress- command had an -if el(...)- in it. Austin Nichols
<[email protected]> has already reported a workaround.
The bug is not easy to provoke. Including an element of a Stata matrix within
the -if- clause
. regress ... if ... <matrix>[..., ...] ...
or
. regress ... if ... el(<matrix>, ..., ...]
such as
. regress price mpg if foreign==mymat[1,1]
or
. regress price mpg if foreign==el(mymat, 1, 1)
prevents -regress- from properly saving e(b) and e(V) in the ereturn results.
This is what causes -test- to then not work after -regress-.
The work around is, as Austin suggested, to avoid using direct references to
matrices in the -if- clause and instead first save the matrix element in a
macro or scalar, e.g.
. local el = mymat[1,1]
. regress price mpg if foreign==`el'
We will fix the bug in the next executable updates of Stata 9 and Stata 10.
-- Yulia
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/