Dirk.Nachbar--
Without actually running your program or testing out anything, it
seems clear that you want -forval- not -foreach- and the `r(mean)'
result does not survive past additional commands (you should save it
as a scalar):
gen hit=(`e(depvar)'==pred)
qui sum hit, meanonly
scalar hitmean=r(mean)
tab `e(depvar)' pred, freq nocol
di in green "the mean hit rate is " %4.3f hitmean
On 02 Jun 2006 16:18:05 +0100, Dirk Nachbar <[email protected]> wrote:
here is a program (the last for this week I promise) which is supposed to
run after various choice models. It should calculate the hit rate of correct
predictions. Two things create problems: the mean hit rate is not shown and
the -foreach- loop doesn't seem to work. Maybe someone would like to take a
closer look.
*
* 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/