I am trying to learn the maximum-likelihood procedure in Stata SE version 8, but am getting error messages when following illustrative examples, one from someone's web site, the other from the Stata manual. Perhaps someone can tell me what I'm doing wrong.
Here is the first example:
use http://www.stata-press.com/data/r8/auto.dta
program define mylogit
args lnf Xb
replace `lnf' = -ln(1+exp(-`Xb')) if $ML_y1==1
replace `lnf' = -`Xb' -ln(1+exp(-`Xb')) if $ML_y==0
end
ml model lf mylogit (foreign=mpg weight)
ml maximize
At this point I get the message
varlist required
(r100);
What do I need to do to fix the syntax?
Thanx,
David Greenberg
Sociology Department
New York University
*
* 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/