Need Example of Iterative Regressions
Posted: Mon Aug 25, 2008 2:51 pm
I'd like to do an iterative regression like the one shown below, and I'm hoping that someone can point me to an example. The basic idea is to feed fitted values from a second regression into the first until the coefficients or perhaps the R-squared of the first converge.
Any suggestions would be most appreciated.
Here's a rough idea of what I want to do.
Any suggestions would be most appreciated.
Here's a rough idea of what I want to do.
Code: Select all
do i=1,50
(1) regress y on x and zHat and error term u
* zHat will not be included in regression (1) the first time it is run.
* Save the coefficients.
set theCoeffs = %beta
* Now run regression (2) which depends on lagged residuals from (1)
(2) regress z on g and uHat{1} and error term e
* Save the fitted values of (2) which will be used in (1) on the next pass
set zHat = fitted values of z from (2)
* Include some criterion for exiting the loop if the coefficients stop changing
end do i