![Statalist](/includes/images/head_statalist.jpg) |
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Wald chi-square and ml with multiple equations
Nobody answered, so I dug around and got an answer myself. Here it is
for anyone who is curious about it.
Any ml procedure will, by default, report the Wald test for the first
equation. From the call to -zinb-, we see a table entry for the Wald
chi2 with 9 degrees of freedom. I want an overall test that covers
equations 1 and 2, with 18 degrees of freedom. If I were writing the
routine, I could add an option to the ml max statement (or model
statement for non-interactive) specifying waldtest(-2), which would make
the table report the test for the first two equations. However, you
cannot mess around with the other people's code to do this, especially
stock Stata commands.
The alternative is to use -test- afterwards, and the most efficient way
to call it is:
test [#2]
test [#1], a
The first call will report a test for equation 2, and the second call,
with the "a" option will give a cumulative test of equation 1 and prior
test.
Results look like this:
. test [#2]
( 1) [inflate]drug = 0
( 2) [inflate]sex = 0
( 3) [inflate]wk_1 = 0
( 4) [inflate]wk_2 = 0
( 5) [inflate]wk_3 = 0
( 6) [inflate]wk_4 = 0
( 7) [inflate]wk_5 = 0
( 8) [inflate]wk_6 = 0
( 9) [inflate]wk_7 = 0
chi2( 9) = 52.06
Prob > chi2 = 0.0000
. test [#1],a
( 1) [inflate]drug = 0
( 2) [inflate]sex = 0
( 3) [inflate]wk_1 = 0
( 4) [inflate]wk_2 = 0
( 5) [inflate]wk_3 = 0
( 6) [inflate]wk_4 = 0
( 7) [inflate]wk_5 = 0
( 8) [inflate]wk_6 = 0
( 9) [inflate]wk_7 = 0
(10) [cignums]drug = 0
(11) [cignums]sex = 0
(12) [cignums]wk_1 = 0
(13) [cignums]wk_2 = 0
(14) [cignums]wk_3 = 0
(15) [cignums]wk_4 = 0
(16) [cignums]wk_5 = 0
(17) [cignums]wk_6 = 0
(18) [cignums]wk_7 = 0
chi2( 18) = 137.09
Prob > chi2 = 0.0000
E. Paul Wileyto wrote:
When I am using ml with a multiple equation model, for instance
<zinb>, the Wald chi-square seems only to reflect the first equation.
Is this correct? Is there any way to specify that the Wald chi-square
should refer to equations 1 and 2?
Example, from our smoking data..
. zinb cignums drug sex wk_*, inflate(drug sex wk_*) vce(cluster subject)
Zero-inflated negative binomial regression Number of obs
= 61187
Nonzero obs
= 25293
Zero obs
= 35894
Inflation model = logit Wald chi2(9)
= 14.20
Log pseudolikelihood = -140745.3 Prob > chi2
= 0.1152
(Std. Err. adjusted for 1108 clusters in
subject)
------------------------------------------------------------------------------
| Robust
| Coef. Std. Err. z P>|z| [95% Conf.
Interval]
-------------+----------------------------------------------------------------
cignums |
drug | -.0456683 .3742062 -0.12 0.903 -.7790989
.6877623
sex | -.6529265 .3798595 -1.72 0.086 -1.397437
.0915844
wk_1 | .3787082 .2037435 1.86 0.063 -.0206218
.7780381
wk_2 | .1070914 .2334659 0.46 0.646 -.3504934
.5646762
wk_3 | .0697002 .194177 0.36 0.720 -.3108797
.4502802
wk_4 | .0677434 .1862907 0.36 0.716 -.2973796
.4328664
wk_5 | .0437185 .0350697 1.25 0.213 -.0250169
.1124539
wk_6 | .00758 .0215772 0.35 0.725 -.0347106
.0498706
wk_7 | .0017718 .0107169 0.17 0.869 -.019233
.0227766
_cons | 3.153936 .3848694 8.19 0.000 2.399606
3.908266
-------------+----------------------------------------------------------------
inflate |
drug | 1.237415 .2633714 4.70 0.000 .7212164
1.753613
sex | -.645983 .2127249 -3.04 0.002 -1.062916
-.2290497
wk_1 | 1.210853 .2290275 5.29 0.000 .7619678
1.659739
wk_2 | 1.012303 .190464 5.31 0.000 .639
1.385605
wk_3 | .839768 .1582912 5.31 0.000 .5295229
1.150013
wk_4 | .6872417 .1480842 4.64 0.000 .3970019
.9774815
wk_5 | .4740839 .1026852 4.62 0.000 .2728246
.6753432
wk_6 | .2748173 .0671609 4.09 0.000 .1431844
.4064501
wk_7 | .1148675 .0404778 2.84 0.005 .0355325
.1942025
_cons | -1.463269 .5311934 -2.75 0.006 -2.504389
-.4221496
-------------+----------------------------------------------------------------
/lnalpha | 1.38432 .1631759 8.48 0.000 1.064501
1.704139
-------------+----------------------------------------------------------------
alpha | 3.992112 .6514166 2.899393
5.496653
------------------------------------------------------------------------------
Thanks
Paul
--
E. Paul Wileyto, Ph.D.
Assistant Professor of Biostatistics
Tobacco Use Research Center
School of Medicine, U. of Pennsylvania
3535 Market Street, Suite 4100
Philadelphia, PA 19104-3309
215-746-7147
Fax: 215-746-7140
[email protected]
*
* 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/