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" <>
Subject   Re: st: hit rate after logit model
Date   Fri, 2 Jun 2006 12:30:41 -0400

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 <> 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:

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