Statalist The Stata Listserver


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

Re: st: wald test


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: wald test
Date   Tue, 23 Jan 2007 01:16:07 +0900

Kit Baum wrote:

Although it is certainly true that the Wald F is the ratio of two chi-
squares, if you want a "large-sample" test of the joint hypothesis, I
would recommend using large-sample statistics throughout. In this
example, glm will produce "OIM" standard errors identical to those of
OLS (regress), but it calls the ratio of coefficient to s.e.  "z" and
evaluates it as "z", that is, N(0,1).

If you do the same regression using
ivreg2 price mpg headroom trunk
you get, by default, z-statistics on the output (unless you use
'small', which reproduces -regress-). The standard errors and z-
statistics are different (slightly smaller) because of the division
by N rather than (N-k). Likewise,
test mpg headroom trunk
after ivreg2 will yield a chi-square which is somewhat larger than
that of glm.

I am not sure how the ratio of coefficients to glm standard errors
should be considered 'z'. These are maximum likelihood estimates,
which customarily use a divisor of N, and the estimate corresponding
to sigma^2 from glm, the 'scale parameter', is  6874339. You will see
that this is exactly the square of 2622, ivreg2's Root MSE, and NOT
the square of 2550, regress's Root MSE. So ivreg2 and glm use the
same estimate of sigma^2 in calculating the vce, but they produce
different vce estimates.

In this regard I think Joanne's request for a 'large-sample joint
test' is better served by ivreg2 followed by test. I don't know much
about glm, but I find it somewhat odd that (a) its sigma^2 is the MLE
estimate (divisor of N) but its vce is the small-sample version
corresponding to (N-k), and (b) what appear to be statistics that are
t_N-k under their null are being quoted as z statistics. Perhaps
someone familiar with glm's methodology could comment on these two
points.

--------------------------------------------------------------------------------

Thanks, Kit.  Nevered noticed that about -glm- before, not that I've paid
attention.  So, Joanne would be better off using -ivreg2- if she wants to
stick to a strictly large-sample Wald test.  Unless she has a hankering to
program it in -ml-, herself.

Joseph Coveney

clear
set more off
set seed `=date("`c(current_date)'", "dmy")' // For -ml search-
sysuse auto
*
capture program drop mlreg
program define mlreg
   version 9.2
   args lnf Bx sigma
   tempvar residual
   quietly {
       generate double `residual' = $ML_y1 -`Bx'
       replace `lnf' = -0.5 * ln(2*_pi) - ///
         ln(`sigma')  -0.5 * `residual'^2 / `sigma'^2
   }
end
*
ml model lf mlreg (B: price = mpg headroom trunk) (sigma:)
ml query
ml check
ml search, nolog
ml maximize, nolog
test mpg headroom trunk // It's in the header, too
ivreg2 price mpg headroom trunk
test mpg headroom trunk
glm price mpg headroom trunk, nolog
test mpg headroom trunk
exit

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