I try to use the following example to estimate the maximum likelihood
estimate, but I got the error message "varlist required". It occurs in
"quitely replace = ln(norm(__000001)) ifdied==1" if I use the -set trace
on- command.
program myprobit_lf
version 8.1
args inf xb
quietly replace `lnf' = ln(norm(`xb')) if $ML_y1==1
quitely replace `lnf' = ln(norm(-`xb')) if $ML_y1==0
end
. sysuse cancer, clear
. gen drug2 = drug==2
. gen drug3 = drug==3
. ml model lf myprobit_lf (died = drug2 drug3 age)
. ml maximize
Thanks,
James Jisheng.
*
* 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/