## Lag Distribution Graph

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

diggetybo
Posts: 152
Joined: Mon Jun 23, 2014 12:04 am

### Lag Distribution Graph

Hello,

I have a question on creating a lag distribution graph in Eviews. I searched the FAQ and a good portion of the forums and nothing came up that was what I was after. Basically a lag distribution graph plots the beta's (coefficients) on the Y axis against its corresponding lag number on the X axis. From this we can see which lags may have large impacts on the left hand side variable.

I'm aware that Eviews has a built in vector autoregressive estimate function, which can also be used to examine appropriate lags to include. For the sake of convention, however, can someone briefly explain how I can manually construct a lag distribution graph to compare all possible lags for a given variable? I beleive there is a genr function for storing the coefficients of the estimate for a given variable (I forget what that is, if someone doesn't mind posting that command, that would be great!!) The point being though, with large sample sizes, it would take an eternity to manually input all the lags I want to measure against the dependent variable to get to the point where we can store the coefficients -- from which point of course, would be easy enough, create a line graph, and simply plot the two data sets (stored coefficients and the corresponding lags from 1 to n), equivalently βX(t-1),βX(t-2), ...βX(t-n-1)

So what it all boils down to, more or less, is what is the most efficient way in eviews to store coefficients of lags, given there may be a large number of lags, well over 100 in my case. Also I'm using Eviews 6, if that's helpful.

10/21/2014 **EDIT**

I have done some experimenting since last week, and for those who are interested, I'll show some of my progress. I found an easy way to manually construct Lag Distribution Graphs. Somethings are still unclear, so bear that in mind, nothing nobel prize worthy yet.

That being said, I'll show you how to construct a Lag Distribution Graph like this:

LDG.png (6.72 KiB) Viewed 1951 times

Before the edit, I forgot coefficients can be selected and copied after each estimation. So, provided that you have inputted the lagged variables 100% sequentially, you can just copy and paste them into a separate series. However the issue remains, how can we get the lags in the first place? Imagine if we had to type var(-1) var(-2) var(-3) all the way to (var-80), that would be difficult. There may be a built-in way in Eviews that we didn't discover yet, meanwhile you can try a little trick. I had to resort to Excel to do the next step, but it should be possible in Eviews too.

Excel: ="ngdp(-"&(ROWS(\$1:2)&")") now you just click and drag down until you get to the number you want, maybe ngdp(-130), as many as you need. Then you copy and paste that column and use them all as regressors back in Eviews.

Eviews: I messed around with this for quite a while, you have to combine text with computation, I ultimately couldn't figure out how, but I tried as follows in an unstructured / undated sheet:

genr lag_var = "ngdp(-"@obs&")" again, my ignorance is showing through here, but I wanted to create a series that read: ngdp(-1) all the way to the end of the observations, in my case ngdp(-88).

*Question 1* Alternatively, does anybody know if Eviews can generate a series by sequence, i.e -1, -2, -3 or multiples, 2, 4, 6, 8, powers, ect? then you could combine it with text and get your regressors that way.

Anyway, thats the hard part, now in the unstructured / undated sheet, paste your coefficients from your estimation, then plot them using line and symbol. The x axis by default is the observations, 1-n, in my case 1-88, which is the number of lags. Of course when you create the sheet, include observations equal to the number of lags you have.

*Question 2* I actually had 174 observations in monthly data, but the most it would let me regress without saying "Error: Insufficient Observations" was 88. Surely we would need to save enough for a normal distribution or OLS can't work, but I'm not sure why I can't regress more. Anybody have any thoughts on that?

Still have some doubts about the whole thing but, you know I used to think it was impossible, so all things considered, its progress haha.

the other issue is, i'm not sure if the lags are included in a single estimation, as I've done, or rather one at a time. I don't see anything built in that can do that, please do point out what I'm missing, if that's the case. That's more fundamentals, you can leave that to me to figure out, but the Eviews UI questions could merit some discussion, maybe.