Statalist


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

st: bug in ivtobit


From   "David Roodman ([email protected])" <[email protected]>
To   <[email protected]>
Subject   st: bug in ivtobit
Date   Thu, 20 Sep 2007 16:37:37 -0400

I just discovered a bug in ivtobit. In "mle" estimation (the default) it
always effectively assumes the censoring cut-off is 0. I think this does
not happen in "twostep" estimation.

Short-term fix: before regressing, subtract the censoring level from
your dependent variable so that the effective censoring level becomes 0.


Stata has confirmed the bug (below).

--David

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Stata Technical
Support
Sent: Thursday, September 20, 2007 3:48 PM
To: David Roodman ([email protected])
Subject: Re: serious bug in ivtobit?



Dear David,

You are absolutely correct; the likelihood function assumes that the
censoring point is always zero.

The last two lines of the likelihood evaluator should be

        qui replace `lnf' = `lnf' + ln(1 - norm((`w'-$IVT_ll) / `s'))
///
                if $ML_y1 <= $IVT_ll
        qui replace `lnf' = `lnf' + ln(norm((`w'-$IVT_ul)/`s'))
///
                if $ML_y1 >= $IVT_ul


When I make those changes, subtracting 10 from the censored value
results in identical results except for the constant term, which
decreases by 10.  Simulation results also show that this change is
necessary.

We will issue a revised version of the command in the next adofile
update.

Thank you for bringing this to our attention.

**********************************************************************
  ___  ____  ____  ____  ____
 /__    /   ____/   /   ____/                      Brian P. Poi, Ph.D.

___/   /   /___/   /   /___/                          Senior Economist 
                                                          StataCorp LP
                                                    4905 Lakeway Drive
                                            College Station, TX  77845
                                                [email protected]
**********************************************************************



You wrote: 

-----Begin Original Message-----
It looks to me like there is a serious bug in ivtobit, at least for the
case of mle estimation with one instrumented variable. I believe the bug
does not affect two-step estimation, and I haven't checked the code for
mle with multiple instrumented variables. The problem I think I see is
that the lnf program (ivtob_1_lf) is written assuming that the censoring
value is always 0. The censoring value itself (equivalently, the value
of $ML_y2 for censored observations) never enters the likelihood
calculation in these lines:

      qui replace `lnf' =3D `lnf' + ln(1 - norm(`w' / `s')) ///

            if $ML_y1 <=3D $IVT_ll

      qui replace `lnf' =3D `lnf' + ln(norm(`w'/`s')) if $ML_y1 >=3D =
$IVT_ul

An example is below, it is based on the example in -help ivtobit-. I
simply run that example, then subtract 10 from the censored variable and
rerun. It seems to me that the results should not change, except for the
constant term, but they do. Please tell me if I am right or wrong about
this!

--David



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