楼主: 坚持坚持lwb
3354 5

[程序分享] 【转帖】 proc sgplot画图 [推广有奖]

  • 9关注
  • 1粉丝

博士生

67%

还不是VIP/贵宾

-

威望
0
论坛币
5432 个
通用积分
107.0733
学术水平
1 点
热心指数
5 点
信用等级
1 点
经验
23819 点
帖子
231
精华
0
在线时间
356 小时
注册时间
2016-3-26
最后登录
2024-3-1

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
  1. SGplot画图样例
复制代码


二维码

扫码加我 拉你入群

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

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

关键词:sgplot gplot plot GPL ROC SAS画图

沙发
坚持坚持lwb 学生认证  发表于 2018-1-13 17:15:50 |只看作者 |坛友微信交流群
/*Grouping a Scatter Plot*/
proc sgplot data=sashelp.class;  
  scatter x=height y=weight / group=sex;  
run;  

/*Plotting Three Series*/  
proc sgplot data=sashelp.stocks  
  (where=(date >= "01jan2000"d and stock = "IBM"));  
  title "Stock Trend";  
  series x=date y=close;  
  series x=date y=low;  
  series x=date y=high;  
run;  

/*Adding Prediction and Confidence Bands to a Regression Plot*/  
proc sgplot data=sashelp.class;  
  reg x=height y=weight / CLM CLI;  
run;  

/*Adding a Prediction Ellipse to a Scatter Plot*/
proc sgplot data=sashelp.iris;  
  title "Iris Petal Dimensions";  
  scatter x=petallength y=petalwidth;  
  ellipse x=petallength y=petalwidth;  
  keylegend / location=inside position=bottomright;  
run;

/*Creating Lines and Bands from Pre-Computed Data*/
proc sgplot data=sashelp.classfit;  
  title "Fit and Confidence Band from Precomputed Data";  
  band x=height lower=lower upper=upper /  
       legendlabel="95% CLI" name="band1";  
  band x=height lower=lowermean upper=uppermean /  
       fillattrs=GraphConfidence2  
       legendlabel="95% CLM" name="band2";  
  scatter x=height y=weight;  
  series x=height y=predict / lineattrs=GraphPrediction  
         legendlabel="Predicted Fit" name="series";  
  keylegend "series" "band1" "band2" / location=inside position=bottomright;  
run;  

/*Adding Statistical Limits to a Dot Plot*/
proc sgplot data=sashelp.class(where=(age<16));  
  dot age / response=height stat=mean  
            limitstat=stddev numstd=1;  
run;

/*Combining Histograms with Density Plots*/
proc sgplot data=sashelp.heart;  
  title "Cholesterol Distribution";  
  histogram cholesterol;  
  density cholesterol;  
  density cholesterol / type=kernel;  
  keylegend / location=inside position=topright;  
run;  


/*Creating a Horizontal Box Plot*/  
proc sgplot data=sashelp.heart;  
  title "Cholesterol Distribution by Weight Class";  
  hbox cholesterol / category=weight_status;  
run;  

/*Creating a Bar-Line Chart*/  
proc sgplot data=sashelp.stocks (where=(date >= "01jan2000"d  
                                 and date <= "01jan2001"d  
                                 and stock = "IBM"));  
   title "Stock Volume vs. Close";  
   vbar date / response=volume;  
   vline date / response=close y2axis;  
run;  

使用道具

藤椅
钱学森64 发表于 2018-1-13 17:54:56 |只看作者 |坛友微信交流群
谢谢分享

使用道具

板凳
坚持坚持lwb 学生认证  发表于 2018-1-13 18:08:27 |只看作者 |坛友微信交流群
钱学森64 发表于 2018-1-13 17:54
谢谢分享
不好意思,刚刚贴错了,现在的是完整的。

使用道具

报纸
坚持坚持lwb 学生认证  发表于 2018-1-13 18:09:23 |只看作者 |坛友微信交流群

使用道具

地板
我在数下 发表于 2018-1-15 21:45:11 |只看作者 |坛友微信交流群
谢谢分享

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-26 15:12