I'm new to Eviews programming which seems so difficult!!
Could someone please indicate how to conduct a regression of de-meaned lagged values?
As far as I can understand the equation should be something like this:
ls(n) y-@mean(y)=c(1)+c(2)*x-@mean(x)(-1)
my dependent variable needs to be = y minus sample mean of y
and independent variable is = x minus sample mean of x (the whole thing is lagged by 1)
When i try to run the regression i get syntax error or near singular matrix error :(
de-meaned regression
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3797
- Joined: Wed Sep 17, 2008 2:25 pm
Re: de-meaned regression
you probably wantI'm new to Eviews programming which seems so difficult!!
Could someone please indicate how to conduct a regression of de-meaned lagged values?
As far as I can understand the equation should be something like this:
ls(n) y-@mean(y)=c(1)+c(2)*x-@mean(x)(-1)
my dependent variable needs to be = y minus sample mean of y
and independent variable is = x minus sample mean of x (the whole thing is lagged by 1)
When i try to run the regression i get syntax error or near singular matrix error :(
Code: Select all
ls(n) y-@mean(y)=c(1)+c(2)*(x(-1)-@mean(x(-1))-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: de-meaned regression
One issue you have to be a bit careful of is the sample over which the means are taken. As written, the mean of the y variable will be taken over the full sample while the mean of the x will be taken over the subsample where x(-1) is non-missing, which may or may not be what you want. These samples may very well differ.
The following is a slightly easier form of the regression which uses the list specification form:
Note the absence of spaces in the expressions. If you want spaces, you should enclose in parentheses as needed. If you don't want to enforce the sample restriction on the means, simply remove the "smpl" statement.
The following is a slightly easier form of the regression which uses the list specification form:
Code: Select all
smpl if y<>na and x(-1)<>na
ls(n) y-@mean(y) x-@mean(x(-1))
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3797
- Joined: Wed Sep 17, 2008 2:25 pm
Re: de-meaned regression
And in following Glenn's advice, be careful as to whether you want X minus mean(lagged X) or (lagged X) minus mean(lagged X).
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: de-meaned regression
I should point out that in my comments I took the original specification literally, with X minus mean(lagged X). Note that if all you want to do is to take lagged X - mean(lagged X), you might as well just include a constant and remove the demeaning since you'll get identical results (unless there is a very specific reason that you wish to demean first).
Who is online
Users browsing this forum: No registered users and 2 guests
