小弟在编写out-of-sample regression 模型进行回归时,遇见问题:
拟合优度过高, 回归结果为:
pr<0.0001 r-squared=0.9904;intercept: parameter 122.84, standard error: 5.46, t value 22.47, pr<0.0001a: parameter 0.43, standard error: 0.00088, t value 495.69, pr<0.0001b: parameter -0.42, standard error: 0.00134, t value -318.68, pr<0.0001c: parameter 0.014, standard error: 0.00244, t value 5.97, pr<0.0001d: parameter 0.912, standard error: 0.29715, t value 3.07, pr 0.0021e: parameter -6.43, standard error: 2.84, t value -2.26, pr 0.0238f: parameter -122.22, standard error: 4.41, t value -27.66, pr<0.0001小弟想请教到底什么地方出现问题,原始程序为:
%let model1=totaltransactionvalue1 priorcap1 totalcommonequity1 gdp1 beta1 percentsought1;
ods pdf file='C:\Users\feng\Desktop\haw project\sas assi\outsample2.pdf' startpage=yes uniform;
%macro out_loop;
%do i=2006 %to 2010;
%v(start_est=1989, end_est=&&i., start_forecast=&&i., end_forecast=&&i.+1);
%end;
%mend outer_loop;
%macro v(start_est= , end_est= , start_forecast= , end_forecast= );
data X;
set a;
if year gt &end_est then xcontrolpremium1=.;
if &start_est<= year <=&end_est then xcontrolpremium1=controlpremium1;
if &start_est<= year <=&end_forecast;
run;
proc reg data=x;
model controlpremium1=&model1;
output out=predicted_out;
title 'regression model';
run;
%mend v;
%out_loop;
ods pdf close;
呼唤jingju和各路大牛给出解答:)
数据我放到了附件中,希望得到大家帮助