Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: collapse


From   Friedrich Huebler <[email protected]>
To   [email protected]
Subject   st: Re: collapse
Date   Mon, 23 Feb 2004 13:16:10 -0800 (PST)

--- "de la Garza, Adrian" <[email protected]> wrote:
> Dear Stata friends,
> 
> I am trying to collapse some variables using the MODE as my
> descriptive statistic, but I see that -collapse- doesn't allow
> this. Any thoughts?
> 
> Thank you.
> Adrian

Adrian,

You can generate the mode before you -collapse- the data.

. sysuse auto
. egen mpgmode = mode(mpg), by(foreign)
. collapse mpgmode, by(foreign)

Friedrich Huebler

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index