|
|
板凳

楼主 |
发表于 2009-8-25 11:52:41
|
只看该作者
Re: 感谢hopewell,最后一个问题。。。
没时间了,就在原来基础上改了改,不知道数对不
其实一直不太清楚,对这样的大量回归计算,怎么去做方程检验呢,请高人指点一下
[code:vujxrccj]data raw;
input syl szzzsyl sjid;
datalines;
0.2 0.2 3
0.3 0.2 3
0.1 0.5 3
0.1 0.2 3
0.5 0.1 3
0.4 0.3 15
0.3 0.4 15
0.1 0.3 15
0.1 0.2 15
0.2 0.1 31
0.3 0.5 31
0.5 0.2 31
0.4 0.1 31
0.4 0.2 31
0.5 0.3 40
0.1 0.2 40
;
%macro create_syl(in_ds);
options nomprint nosymbolgen;
%macro create_reg(id);
ods _all_ close;
ods output Reg.MODEL1.Fit.syl.ParameterEstimates=_temp_reg;
proc reg data=&in_ds(where=(sjid=&id));
model syl=szzzsyl;
run;
quit;
ods _all_ close;
ods listing;
data _null_;
set _temp_reg;
if _n_=1 then call symput('a',put(estimate,best8.));
if _n_=2 then call symput('b',put(estimate,best8.));
run;
data &in_ds;
set &in_ds;
if sjid=&id then do;
a=&a;
b=&b;
end;
run;
%mend;
proc sql;
create table _temp_sjid_list as
select distinct sjid from &in_ds;
quit;
%let dsid=%sysfunc(open(_temp_sjid_list));
%syscall set(dsid);
%let nobs=%sysfunc(attrn(&dsid,nobs));
%do inb_obs=1 %to &nobs;
%let rc=%sysfunc(fetchobs(&dsid,&inb_obs));
%create_reg(&sjid)
%end;
%let rc=%sysfunc(close(&dsid));
proc datasets library=work nolist nodetails;
delete _temp: /memtype=data;
run;
quit;
%mend;
%create_syl(raw)[/code:vujxrccj] |
|