Statalist The Stata Listserver


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

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


From   Richard Williams <[email protected]>
To   [email protected], [email protected]
Subject   Re: st: Can I control the output of --test--?
Date   Fri, 01 Jun 2007 08:12:55 -0500

At 05:11 AM 6/1/2007, [email protected] wrote:
Hi there,

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-- ?
You could use the glm command instead, e.g.

. sysuse auto, clear
(1978 Automobile Data)

. quietly glm price mpg foreign

. test mpg foreign

( 1) [price]mpg = 0
( 2) [price]foreign = 0

chi2( 2) = 28.14
Prob > chi2 = 0.0000


Or, you might consider using nestreg with the lr option, and/or the lrtest command, e.g.

. sysuse auto
(1978 Automobile Data)

. nestreg, lr store(m) quietly: reg price mpg foreign weight

Block 1: mpg
Block 2: foreign
Block 3: weight

+----------------------------------------------------------------+
| Block | LL LR df Pr > LR AIC BIC |
|-------+--------------------------------------------------------|
| 1 | -686.5396 18.35 1 0.0000 1377.079 1381.687 |
| 2 | -683.36 6.36 1 0.0117 1372.72 1379.632 |
| 3 | -670.099 26.52 1 0.0000 1348.198 1357.414 |
+----------------------------------------------------------------+

. lrtest m1 m3, stats

Likelihood-ratio test LR chi2(2) = 32.88
(Assumption: m1 nested in m3) Prob > chi2 = 0.0000

------------------------------------------------------------------------------
Model | Obs ll(null) ll(model) df AIC BIC
-------------+----------------------------------------------------------------
m1 | 74 -695.7129 -686.5396 2 1377.079 1381.687
m3 | 74 -695.7129 -670.099 4 1348.198 1357.414
------------------------------------------------------------------------------

The latter gives a likelihood ratio test of whether the effects of foreign and/or weight differ from 0.

------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME: (574)289-5227
EMAIL: [email protected]
WWW: http://www.nd.edu/~rwilliam

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