Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: AW: Create a flag variable for 10 most frequent values


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: AW: Create a flag variable for 10 most frequent values
Date   Tue, 17 Nov 2009 13:05:42 -0000

Clearly, I do not know what anybody typed if they do not mention that. I just wrote "seems", which means what it says. Also, I did not mention -findit-. 

There is no guarantee that questioners use the most appropriate word, but "most frequent" might suggest "mode" to many statistically-minded people. 

Nick 
[email protected] 

Martin Weiss

" Another bottom line is that nobody seems to be looking around to see
whether the problem has been solved already, at least in part."

How do you know nobody tried to -findit-? In other words: Which terms would
I have to distill from Elan`s initial request and use with -findit- to
notice that -modes- solves this problem?

Nick Cox

Another bottom line is that nobody seems to be looking around to see whether
the problem has been solved already, at least in part. 

-modes- from SJ was updated in 2003: 

SJ-3-2  sg113_1 . . . . . . . . . . . . . . . . . .  Software update for
modes
        (help modes if installed) . . . . . . . . . . . . . . . . .  N. J.
Cox
        Q2/03   SJ 3(2):211
        provides new option for specifying the number of modes to
        be shown

That doesn't create a flag variable, but it seems a reasonable extra option,
so I will add that task to my to-do list. 

Nick 
[email protected] 

Martin Weiss

Bottom line so far: It takes a bit of ingenuity to do what Elan initially
requested, unless somebody comes along with a neat solution...

Cohen, Elan

>>>> I have a string variable dx that represents a patient's diagnosis
(about
>>>> 5,000 unique values).  I'd like to create a "top 10 flag" that equals 1
>>
>> if
>>>>
>>>> dx is one of the top 10 most frequent diagnoses and 0 otherwise.
>>>>
>>>> I'm not even sure where to begin.  If someone could point me in the
>>>> right
>>>> direction, I'd be grateful.  Stata 10, Windows XP


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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