Statalist The Stata Listserver


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

st: RE: Can I control the output of --test--?


From   "Maarten Buis" <[email protected]>
To   <[email protected]>
Subject   st: RE: Can I control the output of --test--?
Date   Fri, 1 Jun 2007 13:33:54 +0200

--- [email protected] wrote:
> According to stata/help, the command --test-- perform a Wald test, but
> outputs the F-statistic rather than the (related) Wald-statistic. Is there
> a way to fix that? (and if not, why?)
>
> I have also noticed a difference between the output of --test-- following a
> call to --reg-- and a call to --logit--. A call to --logit-- outputs a chi2
> (the Wald-statistic) while a call to --reg-- outputs an F.
>
> Is there a simple way to output chi2 after a call to --reg-- and --test-- ?

The F-statistic allows you to take into account the fact that you are 
estimating your statistic in a finite sample. The Chi square statistic is 
an approximation which assumes an infinite sample. Whenever it is possible 
Stata will use the more appropriate F-statistic. This is possible in an
OLS regression like the one performed by -regress- and it is not possible 
after a maximum likelihood estimation like -logit-.

You can trick Stata into thinking that it is not possible to take into 
account that the sample is finite by estimating the model using -glm- 
instead of for instance -regress-, as is shown in the example below. 
(In essence you are estimating an OLS regression using maximum 
likelihood.)

*-------- begin example -----------
sysuse auto, clear
reg price mpg foreign
test foreign
glm price mpg foreign, family(gaus) link(identity)
test foreign
*--------- end example ------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------



*
*   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