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

Re: st: RE: How to roll up data with a time window and condition


From   "Eric G. Wruck" <[email protected]>
To   [email protected]
Subject   Re: st: RE: How to roll up data with a time window and condition
Date   Mon, 7 Nov 2005 15:43:48 -0500

Hi Nick:

I thought I'd check out mvsumm & followed the steps.  Things were looking good:

. ssc install mvsumm
checking mvsumm consistency and verifying not already installed...
installing into ~/ado/plus/...
installation complete.

until I thought I'd try the Grunfeld example.


. webuse grunfeld

. mvsumm invest, stat(mean) win(3) gen(inv3yavg) end
mvsumm8 already defined
(error occurred while loading mvsumm.ado)
r(110);


Any ideas on what could be wrong.  I'm on a Apple PowerBook G4 (OS 10.4.3) with an up-to-date version of Stata 9.1

Thanks,

Eric

 

>. ssc desc mvsumm
>. ssc inst mvsumm
>. help mvsumm
>
>Nick
>[email protected]
>
>Lynda Zhang
> 
>> I would like to roll up the past 4 quarters of sales for each company:
>>
>> Company  Year Quarters  Sales  4_Mo_Sales
>> ABC      1990  1         10
>> ABC      1990  2         10
>> ABC      1990  3         15
>> ABC      1990  4         10     45
>> ABC      1991  1         20     55
>> BBC      1989  1         20   
>> BBC      1989  2         10 
>> BBC      1989  3         20
>> BBC      1989  4         10     60
>> BBC      1990  1         15     55
>> BBC      1990  3         10     35
>>
>> The resulting calculation I am looking to get is in 4_Mo_Sales.
>>
>> Note the following:
>>
>> 1) The first 3 quarters don't have 4 full quarters, so I don't
>> calculate the 4_Mo_Sales for that 3 quarters
>>
>> 2) For BBC, quarter 2 in 1990 is missing, so I only sum up 3 quarters
>> and got 35 in the past 4 quarters
>>
>
>*
>*   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/


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