Dear all,
I tried to program a maximum likelihood following the reference manual
under ml. Here below you can see what I came up with but I am very
confused (and it does not work, I see it could not possibly). I know
there is a book on ML in stata but we don't have it (I ordered it right
now).
My ultimate goal: use (log of) income as a dependant variable in the GSS
dataset and assume it is normally distributed (income in the GSS is
recorded in categories). I told you my ultimate goal in case anybody
kindly has any reference or any idea he/she wants to tell me about it.
My goal for today is to program this very simplified likelihood:
My log likelihood "on paper" is
37*ln(norm((1000-x(i)'beta)/sigma))+30*ln(1-norm((1000-x(i)'
beta)/sigma)))
Where x(i) is the usual i-th row of the matrix of the regressors, and
norm is the cumulative normal
As said I am very confused, what I came up with is:
program define mylikelihood
args lnf theta1 theta2
replace
`lnf'=37*ln(norm((1000-`theta1')/`theta2')+30*ln(1-norm((1000-`theta1')/
`theta2'))
end
ml model lf mylikelihood (Rincome= LB marital educ race xnorcsiz)
ml check
ml search
ml maximize
ml clear
Any idea? Suggestions?
Thank you very much in advance!
Renzo Comolli
*
* 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/