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

st: maximum likelihood

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

. sysuse cancer, clear
. gen drug2 = drug==2
. gen drug3 = drug==3
. ml model lf myprobit_lf (died = drug2 drug3 age)
. ml maximize

James Jisheng.

*   For searches and help try:

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