Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: MLE for Tobit I


From   "Alba J. Collart-Dinarte" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: MLE for Tobit I
Date   Fri, 30 Sep 2011 22:19:22 +0000

Dear Stata listers,

I have an inquiry about programming the likelihood function for Tobit models (type I, censored at zero) in STATA 10.1. This is the code I've written:

program mytobit1
version 10.1
args lnf beta sigma 
quietly replace `lnf'= log(1-normal(`beta'/`sigma')) if $ML_y1==0
quietly replace `lnf'= log((1/`sigma')*normalden(($ML_y1-`beta')/`sigma')) if $ML_y1>0
end

ml model lf mytobit1 (y1 = x) /sigma
ml check
ml maximize, nolog

but it does not run. I believe that there is a problem in the way I define the likelihood function and in "$ML_y1>0".
I have looked into Gould, Pitblado and Poi (2010), but they mainly discuss probit, normal and weibull models.

I have also tried: 
quietly replace `lnf'= cond($ML_y1==0,log(1-normal(`beta',`sigma')),log((1/`sigma')*normalden($ML_y1,`beta',`sigma'))) 
and using normalden($ML_y1,`beta',`sigma') - instead of - normalden(($ML_y1-`beta')/`sigma')
but no success.

Any suggestions on how can I fix the code would be greatly appreciated.

Thank you very much in advance,

Alba Collart
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index