Bookmark and Share

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: Re: st: create a new variable with quarterly average


From   徐鑫 <orientixx@hotmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   Re: Re: st: create a new variable with quarterly average
Date   Mon, 21 Jan 2013 22:39:42 +0800

if u have got many years data, bys year quarter: egen m=mean(var) may helps.

Xin, Xu

From: Maarten Buis
Date: 2013-01-21 22:32
To: statalist
Subject: Re: st: create a new variable with quarterly average
bys quarter : egen m = mean(var)

Hope this helps,
Maarten

On Mon, Jan 21, 2013 at 3:11 PM, A.Silva-Montes <as454@kentforlife.net> wrote:
> Dear Statausers,
>
> I have monthly expenditure data (I already declared the time series dataset) and I want to create a new variable with the expenditure average by quarter and keep having monthly data (I mean I do not want to "collapse" the dataset). I can do it the long way....can someone help me with a shortcut (any specific stata command)?
>
> Thanks, Andres
> -- Kentforlife.net - the email service for alumni of the University of Kent
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/



-- 
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index