Statalist The Stata Listserver


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

st: FW: argmax for -summaraize-


From   "Feiveson, Alan H. (JSC-SK311)" <alan.h.feiveson@nasa.gov>
To   "statalist" <statalist@hsphsun2.harvard.edu>
Subject   st: FW: argmax for -summaraize-
Date   Mon, 24 Jul 2006 15:29:08 -0500

Hello - Does anyone know an efficient way to identify the observation at
which a particular variable is minimum or maximum (subject to `if'
and/or `in') ? 

Apparently -summarize- does not return this value. I see nothing in
-egen- nor  does "findit argmax" produce anything. I can program this
myself by looping through the observations but that is not efficient. In
particular one cannot gurantee that anything like 

summ x
local xmax=r(max)
if x = `xmax' {
...

will work because of rounding. I also wish to avoid -preserve-,
-collapse-, etc

Al Feiveson



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