Dear all,
I m trying to estimate the likelihood function of the ordered probit
model with sample selection.
In the first step I have the participation equation in the second I
have sector choice (agriculture, formal, informal). The exclusion
restriction is non labour income.
I think there is a mistake in my code because after ml maximize the
likelihood function is not concave, even though the model is very
simple.
Here it is my code. Could you help in finding the mistake?
capture program drop myll
program define myll
version 6.0
args lnf I1 I2 rho m1 m2
quietly replace `lnf' = ln(normprob(-`I1')) if $ML_y1==0
quietly replace `lnf' = ln(binorm(`m1'-`I2',`I1', `rho' )) if
$ML_y1==1 & $ML_y2==1
quietly replace `lnf' = ln(binorm(`m2'-`I2', `I1',`rho')- /*
*/ binorm(`m1'-`I2', `I1', `rho')) if $ML_y1==1 & $ML_y2==2
quietly replace `lnf' = ln(1- binorm(`m2'-`I2', `I1',`rho')) if
$ML_y1==1 & $ML_y2==3
end
ml model lf myll (participation: participation=$cntrlp) (choice4:
choice4 =$cntrlc, nocons) /rho /m1 /m2
ml init b
ml maximize, difficult
*
* 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/