turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Forecasting
- /
- Autocorrelation in timeseries data

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-21-2017 11:00 AM

Hi everyone,

Im not an expert in SAS, but I am writing my masterthesis and doing a valuation of the CNY/USD exchange rate.

I am currently trying to build a regression with CNY/USD as the dependent variable and some macro economic factors as independent variables. To test for autocorrelation i have used the following code on all of my variables, including the dependent variable:

PROC ARIMA DATA = sas;

IDENTIFY VAR = dCNY_USD;

RUN;

Attached is the output from the test. As you can see, the output indicates a high level of autocorrelation. It is the same for 7 of my 10 variables. How do I proceed to remove the autocorrelation from my data set?

Hope someone can help me with this problem.

Best regards

Anders

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SASlinn

03-21-2017 05:28 PM

Unless your model potentially includes moving average components, I think you would be better with proc autoreg.

```
PROC AUTOREG DATA = sas;
MODEL dCNY_USD = YEAR / dw=5 dwprob;
RUN;
```

PG

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PGStats

03-22-2017 05:15 AM

Thanks for your answer. I have also tried the DW test as you suggested, using the following code:

proc autoreg data=sas;

model dCNY_USD = dirdiff infdiff dlogfdicn dlogfxrcn dlogfxrus dlogcacn dpsicn dpsius naus / dw=12 dwprob;

run;

You can see the output attached. I used 12th order, as it is monthly data. Are you then suppose to check all the orders for an indication of autocorelation, or just the 12th? Also, as you can see from the output, this test suggests no autocorrelation on first order, while the initial test I did, which I attached in the first post, shows a strong indication of autocorrelation. And so it did for 7 out of my 10 variables. Do you know why the two tests gives so different answers?

I am very greatful for your help.

Anders

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to SASlinn

03-21-2017 11:27 PM

using difference the time series,

the first difference is :

IDENTIFY VAR = dCNY_USD(1);

if it is still correlation,try second difference,

IDENTIFY VAR = dCNY_USD(2);

Or you could let SAS do it for you automatically.

identify var=dCNY_USD esacf p=(0:7) q=(0:8);

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Ksharp

03-22-2017 05:31 AM

Thanks for your answer. I`ve tried your solution, and I have to take 7 or 8 differences for the p-value to start moving up towards 1%. And by using the Durbin-Watson test, it shows no obvious autocorrelation in the regression. I can´t understand why the two tests gives such different answers. Also, how come you can check for autocorrelation on all variables at once in the DW-test, but with the test you suggested, you have to check one variable at the time.

Thanks again.

Anders