On Jun 19, 2004, at 2:33 AM, Alex wrote:
I am embarking on my first programming exercise with stata, and would
appreciate a little advice. The task involves getting a model command
to iterate a number of times with a sub-set of the independent
variables being systematically modified each time using different
values of a scaling factor (say going from 0 to 5 in increments of
0.1). I need to retrieve the log likelihood of each model, and
display them alongside the corresponding values of the scaling factor.
In this way the scalilng factor that results in the model best
fitting the data can be obtained.
I am sure this is all possible, but having read the material in the
users' guide on programming stata, I cannot see a simple way of
storing the different values of the log likelihood in an array (I know
that this is very straight-forward in most other programming
languages), so that they can be conveniently displayed after the model
runs have been finished, for instance by looping a display command
over all the values contained in the array.
Along the lines of my post to Statalist on 4 Jun 2004, please see
http://fmwww.bc.edu/ec-c/s2004/771/movingwindow.do
which stores scalar results from a sequence of OLS regressions in an
array.
Kit
*
* 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/