Statalist


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

st: More than 2 arguments for by


From   "Ashim Kapoor" <ashimkapoor@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: More than 2 arguments for by
Date   Tue, 16 Sep 2008 14:51:26 +0530

Hello everyone:

I want to do the following :

sort year state cnum votes

by year stata cnum votes : keep if _n==_N

That way I get the guy with the max no of votes.

Now when I do this for 1 or 2 arguments for by then it works, but not
for 4 arguments I have . Does by have a limit on how many arguments it
can have ?

I read -help by- and that does mention using by in the following
fashion : -- > by year ( state) . Do I need to put in brackets for the
other arguments?

Could someone please clarify?

Thank you,
Ashim.
*
*   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