Hi, everyone,
I'm wondering if anyone would be able to describe what the process is when Stata
runs the ml maximize command. I am running Stata 8.2
In particular, in my MLE model, I have included a command to display the
contents of a temporary variable.
If Stata loops through my program one datapoint at a time, I would expect to
seee the contents of this temporary variable for every datapoint in my sample.
However, Stata doesn't seem to do this. In the "zero" iteration, it displays my
variable 13 times. In the first iteration, it displays my variable 16 times. In
the second iteration, 9 times.
What is Stata doing to run this program? Thanks in advance.
Stanley
Here is my simple MLE program.
capture program drop mylogit3
program mylogit3
version 8.2
args todo b lnf
tempvar theta1 a c
mleval `theta1' = `b', eq(1)
quietly gen double `a' = exp(`theta1')/(1+exp(`theta1'))
quietly gen double `c' = 1/(1+exp(`theta1'))
di "a = " `a'
mlsum `lnf' = ln(`a'^($ML_y1) * `c'^(1-$ML_y1))
end
sort us_id
ml model d0 mylogit3 (indicator = w_rdsalperc)
ml check
ml search
ml maximize
*
* 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/