目前用的最多的一段sas程序:来自胡大师
data DA19_6; /*1*/
do sex=1 to 2;
do dog=1 to 3;
do time=1 to 3;
input y @@; output;
end; end; end;
cards;
169.8 137.2 31.9 158.4 133.2 18.7
142.8 126.6 18.1 131.8 130.3 17.5
118.0 124.5 18.7 120.8 123.5 24.8
;
run;
proc mixed data=DA19_6; /*2*/
class sex dog time;
model y=sex|time;
repeated / type=VC sub=dog(sex);
ods output fitstatistics=a;
ods output dimensions=a1;
run;
proc mixed data=DA19_6; /*3*/
class sex dog time;
model y=sex|time;
repeated / type=CS sub=dog(sex);
ods output fitstatistics=b;
ods output dimensions=b1;
run;
proc mixed data=DA19_6; /*4*/
class sex dog time;
model y=sex|time;
repeated / type=UN sub=dog(sex);
ods output fitstatistics=c;
ods output dimensions=c1;
run;
proc mixed data=DA19_6; /*5*/
class sex dog time;
model y=sex|time;
repeated / type=AR(1) sub=dog(sex);
ods output fitstatistics=d;
ods output dimensions=d1;
run;
%MACRO SHUJU(dataset,y); /*6*/
data &dataset;
set &dataset;
&y=value;
drop value;
run;
%MEND SHUJU;
%SHUJU(a,VC) %SHUJU(b,CS)
%SHUJU(c,UN) %SHUJU(d,AR1)
%SHUJU(a1,VC) %SHUJU(b1,CS)
%SHUJU(c1,UN) %SHUJU(d1,AR1)
data e; /*7*/
merge a b c d;
run;
data e1; /*8*/
merge a1 b1 c1 d1;
run;
proc print data=e; /*9*/
format _numeric_ 5.1;
run;
proc print data=e1; /*10*/
run;


雷达卡



京公网安备 11010802022788号







