[英]Add Title To SAS Output Graphs
我在SAS中使用模板和sgrender基於不同的類變量創建熱圖。 我希望輸出每次根據類變量將標題更新為類變量的值。 到目前為止,我的代碼是這樣的(如果我告訴它,它會打印一個字符串標題,但我無法使它根據變量而有所不同):
proc template;
define statgraph heatmapparm;
begingraph;
entrytitle 'INSERT TITLE HERE'; *Update title here based on classVar;
layout overlay;
heatmapparm x=magX2 y=magZ2 colorresponse=percent / colormodel=(blue yellow red)
name="heatmapparm" xbinaxis=false ybinaxis=false datatransparency=0;
continuouslegend "heatmapparm" / location=outside valign=bottom;
endlayout;
endgraph;
end;
run;
title #byval(classVar);
proc sgrender data=dataSet template=heatmapparm;
by classVar;
run;
謝謝你們!
使用宏變量來更改標題。 這是一個例子
%let classVar=VARIABLEVALUE1;
title &classVar.;
proc sgrender data=dataSet template=heatmapparm;
by &classVar.;
run;
您始終可以通過將proc sgrender代碼放入SAS MACRO中來編寫更簡潔的代碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.