Statalist The Stata Listserver


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

st: Re: collapse _all


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: collapse _all
Date   Fri, 26 Jan 2007 08:24:33 -0500

Here's one easy way:

ds id year, not
collapse `r(varlist)', by(id year)

Michael Blasnik

----- Original Message ----- From: "Thomas Erdmann" <[email protected]>
To: <[email protected]>
Sent: Friday, January 26, 2007 8:14 AM
Subject: st: collapse _all

I have different "problem" like with the graphs with adressing all variables
when I use -collapse- .

What I want to do is basically:
collapse _all, by (id year)

i.e. just taking the mean of monthly observations per year and company. But
Stata tells me then:

id may not be both target and by()

So is there a way to keep all numerical variable by mean without specifying
them separately in the clist of -collapse- ?
*
*   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