# Beginner looking for help regarding lagged variables

#### illmattic

##### New Member
Hello,

Last couple of days I have attempted to re-educate myself on some of the concepts of statistics that I have long forgotten in the hope that I could reach a level of comprehension sufficient enough to model the relationships between variables and apply the formulas to economic forecasting. After a couple of days I feel overwhelmed by it all. I'm wondering if someone here can help me with lagged variables and how to compute the correlation using a program like R or Gretl. For example, the effect things like bank loan growth and money supply have on inflation.

Thank you
Matt

#### hlsmith

##### Not a robit
So are you just looking for at this point how to get the correlation values for a variable with itself across time (autocorrelation)? What is your current experience with R?

#### illmattic

##### New Member
Well actually I just downloaded R a couple of hours ago. I was experimenting with gretl but found more resources for R so I decided to switch. I'm looking how to adjust correlation to equate for the effect of time lag as influences such as bank loan growth aren't immediately shown in the inflation data and it might take several months. I'm not sure how statistics deals with this problem.

#### noetsi

##### Fortran must die
I only know SAS, but in any case the software is not the problem. There simply are no simple regression that use lagged values. Vector Auto Regression models are the state of the art I think but understanding the results is very difficult to me(and to the field generally based on comments on it). One uses very different tools to interpret the results then normal regression. It can only handle a handful of variables. Before you use this you need to read up on cointegration, because if the variables are cointegrated vector error correction models are (I believe) the correct way to go.

Auto Regressive Distributed Lag is another alternative but I have yet to discover an agreed on way to handle variables integrated of a different order (VAR models do not see this issue as pertinent). If you enjoy pain and have lots of time multivariate arima (aka ARIMA X) is a way to go.

After 7 plus years I gave up trying to do this I plan to cycle back to VAR models eventually.

#### illmattic

##### New Member
Thanks for your help. I just came across a tool on gretl called cross correlogram and it might be what I was after. Any familiarity with this statistic tool?

#### noetsi

##### Fortran must die
Its used in ARIMA but I believe you have to pre whiten the data first to use it (that is identify and address the ARIMA structure, the ma , ar etc). If you use it for more than one variable you have to pre whiten each variable I believe to use this.