Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Wald test cannot be done after reg


From   [email protected] (Yulia Marchenko, StataCorp LP)
To   [email protected]
Subject   Re: st: Wald test cannot be done after reg
Date   Tue, 26 Jun 2007 12:46:42 -0500

[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/



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