Nick, Ernest and Allan,
Thanks for your comments and tips. I am surprised that a statement like "gen
newvar = x(indexvar)" is not available in Stata, since in other packages,
this is everyday meat. In my application, the indexvariable is "time" which
is used in a Markov model that links state probabilities a timepoint t to
those at t-1 and to the transition probabilities to "stay in 1" or to
"switch from 0 to 1", i.e.:
p(y=1|time) = p(y=1|time-1) * p(stay in 1) + p(y=0|time-1) *
p(switch from 0 to 1)
This equation is to be evaluated for 107 timepoints, so using time as an
index, would be very handsome. In the past I implemented the model in
several other packages, (which I dare not mention here), and I now would
like to develop a Stata version as well. In Stata I suppose I have to use
107 equations, then? Ok, if that's all it takes, I'll go for it. Thanks
again, Ben.
*
* 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/