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

st: maximum likelihood


From   Jisheng.Cui@csiro.au
To   statalist@hsphsun2.harvard.edu
Subject   st: maximum likelihood
Date   Mon, 3 Nov 2003 16:18:14 +1100

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/



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