BookmarkSubscribeRSS Feed
SASlinn
Calcite | Level 5

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


Capture1.PNG
4 REPLIES 4
PGStats
Opal | Level 21

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
SASlinn
Calcite | Level 5

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


Capture.PNG
Ksharp
Super User

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);

SASlinn
Calcite | Level 5

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

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Discussion stats
  • 4 replies
  • 1161 views
  • 0 likes
  • 3 in conversation