Rolling regression with de-meaned variables

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

hbana
Posts: 2
Joined: Wed Jun 30, 2010 5:43 pm

Rolling regression with de-meaned variables

Postby hbana » Wed Jun 30, 2010 6:03 pm

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!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13602
Joined: Tue Sep 16, 2008 5:38 pm

Re: Rolling regression with de-meaned variables

Postby EViews Gareth » Wed Jun 30, 2010 6:33 pm

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)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests