Turn on suggestions

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

Showing results for

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

Options

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 03-21-2017 11:00 AM
(1038 views)

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

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.