Page 1 of 1

Rolling regression with de-meaned variables

Posted: Wed Jun 30, 2010 6:03 pm
by hbana
I understand how to do the basic rolling regression program using the FOR loop.

Could someone please indicate how to conduct a regression of de-meaned values using a rolling window? I need to subtract the mean from both the dependent and independent variables. In this case the mean is the sample mean in each sub-sample (each window). :shock:

eg. y - ybar = m(x-xbar) + residual

Thanks!

Re: Rolling regression with de-meaned variables

Posted: Wed Jun 30, 2010 6:33 pm
by EViews Gareth
Apart from the obvious suggestion that you simply include a constant in your regression, to literally do what you want, you simply do this:

Code: Select all

equation eq1.ls y-@mean(y) x-@mean(x)