把sas資料集裡的某個值存成巨集變數(macro)
使用
call symputx ("meanx", meanx);
就可以輕鬆存成巨集變數,symputx("巨集變數名稱", 變數名稱)。
巨集變數可以在任一個data step使用。
範例:
proc means data = mysas.ex7_1 noprint;
var Hardwood_Concentration__xi____;
output out = add (drop = _type_ _freq_)
mean(Hardwood_Concentration__xi____) = meanx;
run;
data...
2016年2月27日 星期六
2016年2月26日 星期五
建立sas永久資料館與匯入excel為sas資料集
建立永久資料館並且開啟sas時自動匯入資料館
記得把enable at startup打勾
data mysas.b11;
code...
run;
匯入excel
...
2016年2月25日 星期四
把sas執行後產出的報表存成sas資料集
data test;
input x y;
datalines;
1 2
3 4
5 6
;
run;
ods trace on / listing;
proc means data = test;
ods output Summary = test32;
run;
ods trace off;
使用ods trace on / listing;
<code>
ods trace off;
可以將sas執行後產出的報表名稱顯示在log上,
在使用ods...
2016年2月24日 星期三
使用 proc reg 找出影響點 (influential observations)

%myreg(data = mysas.b11, y = Quality, x = clarity aroma body flavor oakiness, option = selection = cp)
%macro myreg(data, y, x, option);
/*********************************************************************************************************
*名稱:迴歸 診斷 影響點 ...
訂閱:
文章 (Atom)