# Removing seasonality from data

I have a dataset depicting weekly revenue over time for a computer company. The plot for the data looks like this:

I decomposed the data into its additive components using the decompose function in R and plotted the various components:

Next I tried removing the seasonal component using the following code:

> RevenueDec <- decompose(Revenue)
> RevenueSeasonallyAdjusted <- Revenue  - RevenueDec\$seasonal


However, I still get a seasonal component when I decompose 'RevenueSeasonallyAdjusted':

The y-axis has very small values but the seasonality exists nonetheless.

Could you help me out here.

EDIT: In the next step I tried using the auto.arima function on my seasonally adjusted data to get a forecast and got a plot like this:

Is this the correct approach to use, or should I try something different?

• Why do you decompose RevenueSeasonallyAdjusted again? You already removed the seasonal part, so you should have all you need. If you are asking why you are still getting the seaonal part, it because it is calculated by default in the decompose function. Type decompose in the console and you will see that it is always calculated either by season <- x - trend (for an addative decomposition) or season <- x/trend (for multiplicative decomposition) – David Arenburg Jun 30 '14 at 13:20
• @DavidArenburg: Thanks David. I thought the same but still had my doubts. I have added some things to my question. Could you please go over them. Thanks. – Raunak87 Jun 30 '14 at 13:32
• Why on earth did you take out the seasonal part if you want to forcast with an arima? The seasonality is very important part of building a correct forcast. I'm assuming you are using auto.arima from the forecast package. See here or here on how to add seaosonal part to an auto.arima – David Arenburg Jun 30 '14 at 13:35
• @DavidArenburg: I removed the seasonal component because the data is revenue against time. I don't think that seasonality plays an important part in this data and that there must be some other underlying factor. – Raunak87 Jun 30 '14 at 13:42
• Revenue have to be seasonal. At Least weekly. without doubt yearly. anyway, if you want some syntax help, I'd suggest that you will post your data + your code. Otherwise it is hard to help you – David Arenburg Jun 30 '14 at 13:48