Antoine Terracol <[email protected]>:
Not a bug per se, but a known annoyance to many. Try instead:
sysuse auto, clear
reg price mpg weight
estimates store a
clear
estimates restore a
test mpg
test _b[mpg]=0
*similar when referring to names in e(b) that do not correspond to actual vars:
sysuse auto
svyset [pw=weight]
svy:tab rep78
test _b[p21]=.1
On Fri, Dec 4, 2009 at 1:19 PM, Antoine Terracol
<[email protected]> wrote:
> Dear _all,
>
> I think I found a bug in -test- when using -restore-d estimates when the
> original dataset has been -clear-ed:
>
> . sysuse auto, clear
> (1978 Automobile Data)
>
> . reg price mpg weight
> <snip>
>
> . estimates store a
>
> . clear
>
> . estimates restore a
> (results a are active now)
>
> . test mpg
>
> ( 1) mpg = 0
>
> F( 1, 71) = 0.33
> Prob > F = 0.5673
>
> . test mpg=0
> mpg not found
> r(111);
>
>
> when -test-ing against a given value, Stata gives an error if the variable
> being tested is absent from the dataset.
>
> Now if I
>
> . gen mpg=.
>
> . test mpg=0
>
> ( 1) mpg = 0
>
> F( 1, 71) = 0.33
> Prob > F = 0.5673
>
>
> If a variable with the "correct" name is present, -test- works again as
> expected
>
> Antoine
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/