楼主: suzhzh
1880 2

SAS 如何产生如下所示图? [推广有奖]

已卖:895份资源

学科带头人

54%

还不是VIP/贵宾

-

威望
0
论坛币
17362 个
通用积分
759.9386
学术水平
70 点
热心指数
87 点
信用等级
52 点
经验
532 点
帖子
3228
精华
0
在线时间
1293 小时
注册时间
2009-9-18
最后登录
2026-1-12

楼主
suzhzh 发表于 2013-10-25 10:56:35 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
双纵坐标并按照人分列
R 实现该图应当比较容易, 但是如何同过SAS实现该图呢? 请大侠指教。 我看了看SGPANEL只能产生一个纵轴, SGPLOT只能一次一个人画, 不能画成MATRIX式样。
多谢了。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:matrix sgplot gplot Panel plot 如何

沙发
邓贵大 发表于 2013-10-26 11:09:58
looks like a result from Layout DATAPANEL with secondary axes
Tweaked the standard example (http://support.sas.com/documenta ... in1v612o4bwco3u.htm) a bit to give you some idea
  1. proc template;
  2. define statgraph layoutdatapanel;
  3.   begingraph;
  4.     entrytitle "Annual Furniture Sales Comparisons";   
  5.     layout datapanel classvars=(country year) /
  6.       columns=4 rows=3 rowdatarange=union row2datarange=union skipemptycells=true
  7.       headerlabeldisplay=value
  8.       headerbackgroundcolor=GraphAltBlock:color
  9.       rowaxisopts=(display=(tickvalues) griddisplay=on
  10.         linearopts=(tickvalueformat=dollar12.))      
  11.           row2axisopts=(display=(tickvalues)
  12.         linearopts=(tickvalueformat=comma12.))       
  13.       columnaxisopts=(display=none altdisplay=(tickvalues)        /*show tick values for odd numbered columns*/  
  14.         timeopts=(tickvalueformat=monname3.));
  15.       column2axisopts=(altdisplay=none display=(tickvalues)  /*show tick values for even numbered columns*/
  16.         timeopts=(tickvalueformat=monname3.));
  17.       layout prototype / cycleattrs=true;
  18.         seriesplot x=month y=TotalActual / name="Actual" yaxis=y2 xaxis=x2 /*declare seconary axes*/;
  19.         seriesplot x=month y=TotalPredict / name="Predict";                 
  20.       endlayout;
  21.       sidebar / align=top;        
  22.         discretelegend "Actual" "Predict" / border=false;
  23.       endsidebar;
  24.     endlayout;
  25.   endgraph;
  26. end;
  27. run;
  28. ods graphics/reset;
  29. proc summary data=sashelp.prdsal2 nway;
  30.   class country year month;
  31.   var actual predict;
  32.   output out=prdsal2 sum=TotalActual TotalPredict;
  33. run;

  34. proc sgrender data=prdsal2 template=layoutdatapanel;
  35. run;
复制代码
已有 1 人评分学术水平 热心指数 收起 理由
suzhzh + 1 + 1 热心帮助其他会员

总评分: 学术水平 + 1  热心指数 + 1   查看全部评分

Be still, my soul: the hour is hastening on
When we shall be forever with the Lord.
When disappointment, grief and fear are gone,
Sorrow forgot, love's purest joys restored.

藤椅
suzhzh 发表于 2013-10-27 09:02:04
邓贵大 发表于 2013-10-26 11:09
looks like a result from Layout DATAPANEL with secondary axes
Tweaked the standard example (http:// ...
Sure, it does. I read this code for this example, and got many clues. Thank you .

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-25 04:24