您好我正在尝试在 SAS 中使用 BY GROUP 语句来生成多个图表。我想将每个图打印到以 BY GROUP 变量值命名的单个文件中,另外我想为每个图添加一个脚注,我想在图 1 中添加文本“此图为 2300-01”并希望将其增加1 用于“此图为 2300-02”的下一张图,依此类推。
goptions reset=all border;
data grainldr;
length country $ 3 type $ 5;
input year country $ type $ amount;
megtons=amount/1000;
datalines;
1995 BRZ Wheat 1516
1995 BRZ Rice 11236
1995 BRZ Corn 36276
1995 CHN Wheat 102207
1995 CHN Rice 185226
1995 CHN Corn 112331
1995 INS Wheat .
1995 INS Rice 49860
1995 INS Corn 8223
1995 USA Wheat 59494
1995 USA Rice 7888
1995 USA Corn 187300
;
proc sort data=grainldr out=temp;
by country;
run;
proc sgplot data=temp (where=(megtons gt 31));
by country;
series x=type y= amount;
series x=type y=megtons;
title "Leading #byval(country) Producers"
j=c "1995 and 1996";
footnote1 j=r "This graph is 2300-&XY.";
run;
辞职;