Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: hit rate after logit model


From   "Austin Nichols" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: hit rate after logit model
Date   Fri, 2 Jun 2006 12:30:41 -0400

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 <Dirk.Nachbar@dwp.gsi.gov.uk> 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/



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