Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: maximum likelihood procedures for oprobit


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: maximum likelihood procedures for oprobit
Date   Wed, 07 Dec 2005 22:58:39 -0500

At 09:29 PM 12/7/2005, Sunhwa Lee wrote:
Hello,
I am writing an ml program that replicates "oprobit" code in stata. With
all many trials, I have not succeeded in getting the exactly identical
estimates as with "oprobit" command. Below is the basic program I used to
compare with oprobit estimates.

**************************************
capture program drop myoprobit
    program define myoprobit
    args lnf xb  t1 t2 t3
    tempvar p1 p2 p3 p4
    qui gen double `p1'=ln(norm(`t1'-`xb'))
    qui gen double `p2'=ln(norm(`t2'-`xb')-norm(`t1'-`xb'))
    qui gen double `p3'=ln(norm(`t3'-`xb')-norm(`t2'-`xb'))
    qui gen double `p4'=ln(norm(`-t3'+`xb'))
This line is wrong.  It should be

    qui gen double `p4'=ln(norm(-`t3'+`xb'))



The two results look similar at the first glance, but if you take a closer
look, _Iturn_32 and _Iturn_46 are different. The differences may be
negligible with auto.dta, but they are amplified with my dataset, again on
dummies.
i assume the oprobit command was

xi: oprobit rep mpg i.turn

Under either your program or oprobit, the standard errors for _Iturn_32 and _Iturn_46 are enormous. oprobit gives the error

Note: 4 observations completely determined. Standard errors questionable.

The actual estimates reported by oprobit for those two parameters are

------------------------------------------------------------------------------
rep78 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_Iturn_32 | 10.03019 9014619 0.00 1.000 -1.77e+07 1.77e+07
_Iturn_46 | -8.896943 5353941 -0.00 1.000 -1.05e+07 1.05e+07

There may or may not be other problems in your program, but I don't think a small dataset using lots of dummy variables, where the counts for some categories are as low as 1, is a good way of testing it.


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
*
* 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