Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: tscollap - converting monthly data to annual averages
From
David Ashcraft <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: tscollap - converting monthly data to annual averages
Date
Fri, 27 Jul 2012 05:10:43 -0700 (PDT)
It worked out. In the last line, I just changed -collapse rp rm, by (id dm)-. I have to check to numbers otherwise, it seems fine now.
Regards
David
----- Original Message -----
From: Nick Cox <[email protected]>
To: "[email protected]" <[email protected]>
Cc:
Sent: Friday, July 27, 2012 2:10:36 PM
Subject: Re: st: tscollap - converting monthly data to annual averages
Presumably you should add your firm identifier variable to the -by()-
option of -collapse-.
Nick
On 27 Jul 2012, at 07:43, David Ashcraft <[email protected]>
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/
*
* 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/