Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

Re: st: tscollap - converting monthly data to annual averages


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: tscollap - converting monthly data to annual averages
Date   Fri, 27 Jul 2012 12:10:36 +0100

Presumably you should add your firm identifier variable to the -by()- option of -collapse-.

 Nick

On 27 Jul 2012, at 07:43, David Ashcraft <ashcraftd@rocketmail.com> wrote:

Nick: I got my mistake. I have the following code for collapse now:

gen dm = yofd(date2)
format dm %ty
collapse rp rm, by(dm)

It has collapsed the data. However, as mentioned previously, It should collapse by year and by firm. At the moment, it is collapse only by year

















*
*   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   |   Site index