According to the documentation, the -ml- command will provide a Wald test
(rather than an LR test) when you specify robust, cluster or
pweights. However, I am finding that it also provides a Wald test when you
use the -constraint- option. Why? This isn't mentioned in the
documentation. Is there some mathematical reason for this, or is it a
bug/limitation of the software, or what? The log likelihood is being
reported for the constrained model (not a pseudo log likelihood) so I don't
understand why it can't give me a LR chi-square instead of a Wald
chi-square for the model.
Here is a simple example. The program for the likelihood function is
program define mylogit
args lnf Xb
replace `lnf' = -ln(1+exp(-`Xb')) if $ML_y1==1
replace `lnf' = -`Xb' - ln(1+exp(-`Xb')) if $ML_y1==0
end
Using this program, I
(a) estimate a constant only model. This gives me the info the subsequent
model needs to compute a LR chi-square
(b) run an unconstrained model. LR chi-square is reported
(c) run the constant-only model again
(d) run a constrained model where the effect of 1 variable is constrained
to be 0. It reports Wald chi-square instead of LR chi-square. Why? I can
get an LR chi-square by rerunning the variable dropped, and LL is being
reported (and it is correct) so why can't I get LR chi-square in the
output? (A workaround is to use -estimates store- and -lrtest- but I'd
rather save all that trouble.)
------------------------
. webuse auto
(1978 Automobile Data)
. * Null model
. ml model lf mylogit (foreign=)
. quietly ml maximize
. * Unconstrained Model
. ml model lf mylogit (foreign=mpg weight), continue
. ml maximize, nolog
Number of obs = 74
LR chi2(2) = 35.72
Log likelihood = -27.175156 Prob > chi2 = 0.0000