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

RE: st: RE: seasonality


From   "kelly johnson" <econometrics@hotmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: RE: seasonality
Date   Fri, 01 Apr 2005 11:42:00 -0500

hi nick,

thank you for your reply. i express my seasonality question a bit clearer. suppose we are looking at five years of stock retruns data. how can we test for teh presence of seasonality in specific months?
if i were to do the typical adjustment, i'd first calculated the average over teh entire time period, and divide my returns by that average. call the new variable rtn_adj. then i would have to average, by month, to get the seasonl adjsutement indices for each month (which should sum up to 12). i can then retruns and multiply teh original data by each of the appropriate seasonal adjsutemtn factor. My question: is there a simpler was to do this? also, how can i do f-test to test teh presence of seasonality? to give youa better idea, i'm attaching a sample of the data to give you an idea what i'm looking at.

regards

kelly

Date Returns
December-04 0.072894168
November-04 0.035794183
October-04 0.084951456
September-04 -0.02658003
August-04 0.030641234
July-04 -0.079050645
June-04 -0.04955595
May-04 0.050373134
April-04 -0.08951928
March-04 -0.026942149
February-04 0.044003451
January-04 0.002421726
December-03 0.033428674
November-03 -0.038666438
October-03 0.105853288
September-03 -0.00472858
August-03 -0.007695195
July-03 0.164844775
June-03 0.078010841
May-03 0.058632735
April-03 0.159722222
March-03 0.03877367
February-03 -0.022333235
January-03 -0.077277657
December-02 -0.127513603
November-02 0.150830384
October-02 0.151771715
September-02 -0.09015691
August-02 0.015942029
July-02 -0.115838032
June-02 -0.005353046
May-02 -0.025341615
April-02 -0.242709313
March-02 0.154932638
February-02 -0.056193601
January-02 -0.021865597
December-01 0.04049259
November-01 0.14589811
October-01 0.080640993
September-01 -0.21329808
August-01 -0.045789678
July-01 -0.084547069
June-01 -0.088111435
May-01 0.058097686
April-01 0.111005331
March-01 -0.075026418
February-01 -0.173868762
January-01 0.065581395
December-00 0.178082192
November-00 -0.171207993
October-00 0.060523358
September-00 -0.08892789
August-00 0.126730389
July-00 0.123911836
June-00 0.166090713
May-00 -0.02690206
April-00 -0.029177719
March-00 0.024456522
February-00 0.19272002
January-00 0.041277259





From: "Nick Cox" <n.j.cox@durham.ac.uk>
Reply-To: statalist@hsphsun2.harvard.edu
To: <statalist@hsphsun2.harvard.edu>
Subject: st: RE: seasonality
Date: Fri, 1 Apr 2005 16:57:48 +0100

Welcome back after your hiatus.

To centre a variable you need to go

su y, meanonly
gen yc = y - r(mean)

except that this is such a common need
that users have created commands to
do that for you. For example, look at Ben Jann's
-center- on SSC:

. ssc desc center

Your question about seasonality is much
fuzzier. There are lots of different ways
of testing for seasonality. In the
environmental sciences, I would usually
try fitting sine and cosine terms given
2 * pi * (position in year / length of year).
That is, also, I guess a congenial approach
for most natural scientists.

With economic or social data other methods appear
more common, and may or may not be more
appropriate. People seem happier with looking
at lags 4, 12, whatever depending on whether
data are quarterly, monthly, whatever. That may
be what SAS command proc x12 does. But
the adjustments seem much more complicated
given complications like holidays that are
irrelevant outside the human sphere.

In any case, graphics are often useful
for getting a handle on seasonality and
often surprising neglected by people like
economists.

Without knowing more about your data
or your research problem this is rather too
large a question to answer well. In short, the
question may be quick but the answer isn't.

Nick
n.j.cox@durham.ac.uk

kelly johnson

> I am returning to stata after a hatus of a couple of years. I
> had two quick questions:
>
> Suppose I am using a stream of time seies data for a single
> varible (Data, Variable1):
>
> (1) suppose i wanted to generate a new varible that equale
> variable1 - the
> mean of varible1. how do i do this (without having to create
> a whole column
> with only the mean of variable1 in it)?
>
> (2) is there an easy wasy to test for seasonality? in sas we
> have the proc
> x12 command? what's a quickand eqasy way to test for
> seasonality in data?


*
*   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/
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index