Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • deseasonalize time series

    I'm using stata 14 with Windows 10 OS.

    I dealing with quarterly accounts receivable and payables data. I want to deseasonalize but I have no idea how.


    The data below is a pick of the mean receivables over all firms of my sample by quarter (because it shows the overall seasonal tendency). Does anyone knows how to smooth this time series?

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(qdate meanRec)
    159  .7051772
    160  .9537871
    161 .52570915
    162  .3577844
    163  .4055271
    164 1.5014802
    165  .6501129
    166 .40079415
    167  .4518343
    168 2.0093749
    169  .8835684
    170   .551052
    171  .5462328
    172 1.5105826
    173   .778314
    174  .5514978
    175  .6027386
    176 1.5464938
    177  .9570103
    178  .6769719
    179  .7758076
    end
    format %tq qdate

  • #2
    Lots of ways to do it, the best probably being a structural time series model.

    Meanwhile, a naive regression approach is of a little interest:


    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(qdate meanRec)
    159  .7051772
    160  .9537871
    161 .52570915
    162  .3577844
    163  .4055271
    164 1.5014802
    165  .6501129
    166 .40079415
    167  .4518343
    168 2.0093749
    169  .8835684
    170   .551052
    171  .5462328
    172 1.5105826
    173   .778314
    174  .5514978
    175  .6027386
    176 1.5464938
    177  .9570103
    178  .6769719
    179  .7758076
    end
    format %tq qdate
    
    gen quarter = quarter(dofq(qdate)) 
    
    tsset qdate 
    reg meanRec L1.meanRec qdate i.quarter 
    
    predict crude
    
    line meanRec crude qdate, xtic(`=yq(2000,1)-0.5'(4)`=yq(2005,1)-0.5', tlength(*3)) ///
    xla(`=yq(2000,2)+0.5'(4)`=yq(2004,2)+0.5', format(%tqCY) tlength(0)) xtitle("")

    Click image for larger version

Name:	quarterly.png
Views:	1
Size:	42.5 KB
ID:	1451747

    Comment


    • #3
      Hey Nick.

      Actually I don't to mitigate the higher spikes. I believe they are just the effects I want to measure. Nevertheless, we can see that every forth quarter we have a small spike tendency that might be questioned about driving some results. I like to deseasonalize the time series to mitigate such questions.

      Comment


      • #4
        As I commented in 2006, economists see seasonality as a nuisance and environmental scientists and epidemiologists see it as interesting structure.

        So, just fit a model with quarterly indicators.

        Comment


        • #5
          i see. It makes sense.

          Thanks Nick

          Comment

          Working...
          X