楼主: 08liurenxing
4100 11

请教sas做象限图 [推广有奖]

  • 0关注
  • 2粉丝

已卖:1254份资源

讲师

16%

还不是VIP/贵宾

-

威望
0
论坛币
4932 个
通用积分
6.5679
学术水平
8 点
热心指数
11 点
信用等级
5 点
经验
7740 点
帖子
424
精华
0
在线时间
153 小时
注册时间
2009-11-9
最后登录
2023-12-9

楼主
08liurenxing 发表于 2010-4-9 16:04:03 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
请教高手,sas如何做象限图
二维码

扫码加我 拉你入群

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

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

关键词:请教高手 请教 SAS 象限

回帖推荐

horace_chen 发表于2楼  查看完整内容

SAS官网的一个例子,程序注释详细,annotate语句相关内容比较多,关键语句不多。

本帖被以下文库推荐

沙发
horace_chen 发表于 2010-4-10 16:10:51
SAS官网的一个例子,程序注释详细,annotate语句相关内容比较多,关键语句不多。


  1. /* AXIS and BUBBLE statement options create a bubble */
  2. /* plot divided by reference lines into quadrants. The */
  3. /* Annotate facility positions the labels for the */
  4. /* quadrant, reference lines and bubbles. */
  5. /*******************************************************/


  6. goptions reset=global gunit=pct cback=gray88 ctext=white
  7. ftext=swissl htext=2.5 border;

  8. /* Create input data set, AUTODATA. AUTODATA contains */
  9. /* the results of an informal local survey of selected */
  10. /* automobiles. SHARE is the percent of total autos */
  11. /* surveyed. RATING indicates practicality vs. */
  12. /* sportiness on a scale of 1 to 10. PRICE is cost in */
  13. /* thousands of dollars. */

  14. data autodata;
  15. input auto $ 17. share rating price;
  16. datalines;
  17. Mazda Miata .10 9.4 15.2
  18. Chevy S-10 .10 2.9 13.8
  19. Infiniti M30 .075 7.2 24.3
  20. Ford Taurus .10 4.3 13.3
  21. Plymouth Voyager .20 1.8 13.2
  22. Toyota Cressida .15 6.0 23.7
  23. Honda Civic .10 3.7 7.0
  24. Acura Integra .175 6.5 12.1
  25. ;


  26. /* Create the annotate data set, LABELS. LABELS adds */
  27. /* text to the quadrants and labels the bubbles with the */
  28. /* make of auto represented. Because the value of WHEN */
  29. /* is a (after), Annotate adds the text after the plot */
  30. /* is drawn. */

  31. data labels;
  32. length color $ 8 text $ 17;
  33. retain function 'label' hsys '3' style 'swissi' when 'a';

  34. if _n_=1 then
  35. do;
  36. xsys='1'; ysys='1'; size=3; color='blue';
  37. /* The labels are positioned using the absolute percent */
  38. /* of the data area, the coordinate system 1. */

  39. y=97; /* Vertical position for labels across the top of the plot. */
  40. x=1; position='C'; text='Economical and'; output;
  41. position='F'; text='Sporty'; output;

  42. x=50; position='B'; output; /* The value of TEXT remains 'Sporty'. */

  43. x=99; position='A'; text='Expensive and'; output;
  44. position='D'; text='Sporty'; output;

  45. y=50; /* Vertical position for the two vertical reference line labels. */
  46. x=1; position='F'; text='Economical'; output;
  47. x=99; position='D'; text='Expensive'; output;

  48. y=5; /* Vertical position for labels across the bottom of the plot. */
  49. x=1; position='C';text='Economical and'; output;
  50. position='F'; text='Practical'; output;


  51. x=50; position='E'; output; /* The value of TEXT remains 'Practical'. */

  52. x=99; position='A'; text='Expensive and'; output;
  53. position='D'; text='Practical'; output;
  54. end;

  55. /* Values from AUTODATA provide the text and position of the bubble labels. */
  56. /* Since the values of plot variables position the bubble labels, the */
  57. /* coordinate system is absolute data values (2). */

  58. set autodata;
  59. drop share rating price auto;
  60. text=auto; x=price; y=rating; xsys='2'; ysys='2'; position='5';
  61. style='swiss'; size=2.5; color='red'; output;
  62. run;

  63. /* Add the title and footnotes. */

  64. title1 height=5
  65. 'Market Analysis of Selected Automobiles';
  66. footnote1 justify=left ' SAS/GRAPH' move=(+0,+.5) '02'x move=(+0,-.5)
  67. ' Software' justify=right 'MARKET ';

  68. /* Create axis definitions */

  69. /* ORIGIN= aligns the plot with the title by specifying the same */
  70. /* distance from the left edge as the MOVE= in TITLE1. */

  71. axis1 order=(5 to 27) origin=(3,10) length=65 label=none value=none
  72. major=none minor=none;

  73. /* OFFSET= offsets the ends of the vertical axis to prevent a collision */
  74. /* between the bubble and the axis frame. Other options suppress lables */
  75. /* and tick marks. */

  76. axis2 order=(0 to 10) offset=(2,2) length=80 value=none label=none
  77. major=none minor=none ;


  78. /* Produce the bubble plot. Reference line options in the BUBBLE */
  79. /* statement draw and color the dashed lines that divide the quadrants. */
  80. /* BCOLOR= selects the color of the bubbles. CTEXT= affects the color */
  81. /* of the bubble value displayed by BLABEL. The BUBBLE statment includes */
  82. /* the annotation defined in the LABELS data set. NOTE statements */
  83. /* explicitly place text to the right of the plot. */

  84. proc gplot data=autodata;
  85. format share percent7.1;
  86. note height=2 move=(70,25) 'Bubble size and labels'
  87. move=(70,20) 'represent the market share,'
  88. move=(70,15) 'in percent, of autos'
  89. move=(70,10) 'in this survey.';
  90. bubble rating*price=share / bsize=12 bcolor=red blabel ctext=red
  91. href=16 chref=blue lhref=2 haxis=axis1
  92. vref=5 cvref=blue lvref=2 vaxis=axis2
  93. cframe=white annotate=labels;
  94. run;
  95. quit;
复制代码
已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 3 精彩帖子

总评分: 经验 + 3  论坛币 + 3   查看全部评分

藤椅
zhuyuefeng555 发表于 2010-4-10 16:14:29
2# horace_chen
谢谢了。

板凳
08liurenxing 发表于 2010-4-10 17:11:57
感激horace_chen

报纸
tianye 在职认证  发表于 2011-4-14 18:08:47
好复杂啊 看不懂

地板
wzy_630 发表于 2011-4-24 22:18:49
受用了
有没有比较小篇幅的专门介绍sas画图的书可推荐的?

7
陌离 发表于 2011-4-25 21:08:22
2# horace_chen

请教在SAS 官网的哪个部分可以看到sas code 的例子呢?

8
sxlion 发表于 2011-4-27 17:48:38
proc gsplot 用refline啊,很简单的说。

9
sxlion 发表于 2011-4-27 17:49:15
网上免费资源可以看一看的。http://saslist.net/archives/124

10
userzht 发表于 2014-10-11 10:01:06
sxlion 发表于 2011-4-27 17:49
网上免费资源可以看一看的。http://saslist.net/archives/124
好人!!!

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-26 06:12