Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Ingo Isphording <Ingo.Isphording@rub.de> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: Problems with ML: misclassification-adjusted oprobit |
Date | Tue, 23 Nov 2010 11:52:06 +0100 |
Dear all, I am trying to implement the misclassification adjustment for binary choice models proposed by Hausman et al. 1998 via maximum likelihood. ml check returns an error 133. I am quite a rookie in ml maximization, so maybe my problem is just a silly typo. So here is my program. Do you have any suggestions? Many thanks and best regards, capture program drop mc_prob program define mc_prob args lnf beta1 p01 p10 quietly replace `lnf'=ln(`p01'+(1-`p01'-`p10')*normal(`beta1')) if $ML_y1==1 quietly replace `lnf'=ln(1-`p01'-(1-`p01'-`p10')*`beta1') if $ML_y1==0 end . ml model lf mc_prob (yvar = $expvar, nocons) . ml check Test 1: Calling mc_prob to check if it computes log likelihood and does not alter coefficient vector... FAILED; mc_prob returned error 133. Here is a trace of its execution: ------------------------------------------------------------------------------ -> mc_prob __000004 __000003 - `begin' = capture noisily version 9: mc_prob __000004 __000003 ---------------------------------------------------------------------------------------------- begin mc_prob --- - args lnf beta1 p01 p10 - quietly replace `lnf'=ln(`a01'+(1-`a01'-`a10')*normal(`beta1')) if $ML_y1==1 = quietly replace __000004=ln(+(1--)*normal(__000003)) if yvar==1 unknown function +() ------------------------------------------------------------------------------------------------ end mc_prob --- - `end' = set trace off ------------------------------------------------------------------------------ Fix mc_prob. r(133); * * 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/