Statalist


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

st: AW: nummode option giving error message. why?


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: nummode option giving error message. why?
Date   Wed, 26 Aug 2009 23:35:30 +0200

<>


The documentation for -egen- is indeed unclear on this point:


******
clear*
set obs 1000

gen x=1+int(10 /* 
*/ *runiform())

gen byte dummy=_n<=`=_N/2'

bys dummy: egen mymode = /* 
 */ mode(x), num(1)
******

The code leads to an error although the help file does not make the source
of the error clear - nor does the dialog box keep one from specifying -by-
and -nummode- simultaneously. 


For -nummode(1)-, the equivalent

***
bys dummy: egen mymode = /* 
 */ mode(x), min
***

works fine, so Dalhia can get what she wants...


HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Dalhia
Gesendet: Mittwoch, 26. August 2009 23:16
An: statalist@hsphsun2.harvard.edu
Betreff: st: nummode option giving error message. why?

hi, 

I am trying to use the nummode option for 'egen mode'. Here is the exact
command:

bysort  name1: egen additionalcusip1=mode( cusip), nummode(1)

The same command when used with the maxmode or minmode option works fine,
but when I use nummode (which is what I need), stata gives me the following
error:

option nummode() may not be combined with by

Can anyone tell me why this is happening? Is this a bug in stata or am I
doing something wrong?

dalhia




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


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index