Page 1 of 1

MSE in the restricted OLS

Posted: Tue Jan 05, 2016 2:23 pm
by yelena
Dear Tom,
I am trying to report goodness-of-fit statistics for several models. If I have a restricted OLS (say, I restrict two parameters), then the degrees of freedom will change. Should I divide TSS by the new degress of freedom (68) or not (66)? The code is attached:

linreg(robusterrors) DEPENDENT sambeg samend residMod coefMod
# constant YOY%_DJT{1} BAA{2} YOY%_OIL{2} YOY%_CPI TR10Y{1} YOY%_HPI{1} TR3M YOY%_CRE UR

restrict(create) 2 residModb1
#4
#1 beta3
#8
#1 beta7

compute Dmean_2 = %mean
dis 'Dmean_2 = ' Dmean_2

compute nobs_2 = %nobs
dis 'nobs_2 = ' nobs_2

compute ndf_2 = %ndf
dis 'ndf_2' ndf_2

set FITTED_2 1996:2 2015:1 = %beta(1) + %beta(2) * YOY%_DJT{1} + %beta(3) * BAA{2} + %beta(4) * YOY%_OIL{2} + %beta(5) * YOY%_CPI $
+ %beta(6)* TR10Y{1} + %beta(7) * YOY%_HPI{1} + %beta(8) * TR3M + %beta(9) * YOY%_CRE + %beta(10) * UR


set DF2_2 1996:2 2015:1 = (DEPENDENT - FITTED_2)^2
compute start = 1996:2
compute end = 2015:1
compute DF2sum_2 = 0.0;
do i = start,end
compute DF2sum_2 = DF2sum_2 + DF2_2(i);
end do i;
compute RSS_2 = DF2sum_2
dis 'RSS_2 =' DF2sum_2

set DM2_2 1996:2 2015:1 = (DEPENDENT - Dmean_2)^2
compute DM2sum_2 = 0.0;
do i = start,end
compute DM2sum_2 = DM2sum_2 + DM2_2(i);

end do i;
compute TSS_2 = DM2sum_2
dis 'TSS_2 =' TSS_2

compute MSE_2 = RSS_2/ndf_2;
dis 'MSE_2 = ' MSE_2

compute RSQUARED_2 = (TSS_2 - RSS_2)/TSS_2;
dis 'RSQUARED_2 = ' RSQUARED_2

compute RMSE_2=sqrt(MSE_2);
dis 'RMSE_2 = ' RMSE_2

Re: MSE in the restricted OLS

Posted: Fri Jan 08, 2016 2:36 pm
by TomDoan
LINREG(CREATE) recomputes the residuals, and some other summary statistics, including the standard error of estimate, which uses a correct values for the degrees of freedom. It doesn't compute a new R^2 since there's no way to know if the restriction will break the assumptions under which the R^2 makes sense.