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

st: My first Maximum Likelihood

From   "Renzo Comolli" <>
To   <>
Subject   st: My first Maximum Likelihood
Date   Tue, 22 Oct 2002 13:23:55 -0400

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

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
 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
 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:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index