I fit a regression with 37 variables to my entire dataset and got regression results. One of the variable is the distance in miles (dist). I believe that my data follows two distinct regimes with respect to this variable dist. Therefore, I am testing for a structural break at each distance points to maximize a ML function.
For each distance break (0 to 58), I subset the data in two and compute the OLS regression for the paired dataset. The optimal distance break is chosen according to these regression residuals by maximizing a likelihood function (not presented here).
for (i in 1:60){
Chicago.near <- subset(Chicago, loop<=i-1)
Rnear <- lm(data = Chicago.near, log_price ~ as.factor(year) + .... + dist)
Chicago.far <- subset(Chicago, loop>i-1)
Rfar <- lm(data = Chicago.far, log_price ~ as.factor(year) + ... + dist)
}
While this procedure works, it sets freely the other variables in each regression. However, I want to impose the same coefficients on the other 36 variables (coming from the pooled regression).
How to therefore constrain 36 coefficients in my paired regressions?