Proc sgplot ——SAS statistical graphics procedure

from http://blog.sina.com.cn/s/blog_4b62a6270100g65q.html

SAS 9.2 新增的过程步 proc sgplot提供了强大的绘图功能。

几个简单的例子:

 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;

PROC SGPLOT DATA = test9;
  TITLE ‘PEMOVR’;
  SERIES X = Date Y =pred / group=Month_ratio  MARKERS LINEATTRS = (THICKNESS =3);
  XAXIS TYPE = DISCRETE;
  keylegend / location=inside position=top;
run;

proc sgplot data=sashelp.class(where=(age<16));
 dot age / response=height stat=mean
           limitstat=stddev numstd=1;
run;

proc sgplot;
  vbar day / response=t stat=mean limits=both LIMITSTAT=STDERR BARWIDTH=0.4 ;
  vline day / response=h stat=mean limits=both LIMITSTAT=STDERR y2axis;
  yaxis min=0 max=30 ;
  y2axis min=0 max=600 ;
run;

proc sgplot 具体选项设置: http://support.sas.com/documentation/cdl/en/grstatproc/61948/HTML/default/sgplot-chap.htm

 PROC SGPLOT Statement 
 BAND Statement 
 DENSITY Statement 
 DOT Statement 
 ELLIPSE Statement 
 HBAR Statement 
 HBOX Statement 
 HISTOGRAM Statement 
 HLINE Statement 
 INSET Statement 
 KEYLEGEND Statement 
 LOESS Statement 
 NEEDLE Statement 
 PBSPLINE Statement 
 REFLINE Statement 
 REG Statement 
 SCATTER Statement 
 SERIES Statement 
 STEP Statement 
 VBAR Statement 
 VBOX Statement 
 VECTOR Statement 
 VLINE Statement 
 XAXIS, X2AXIS, YAXIS, Y2AXIS Statements 

SUGI上一篇很好的的教程:

Using PROC SGPLOT for Quick High Quality Graphs.pdf

http://support.sas.com/resources/papers/proceedings09/158-2009.pdf

 

分享到:更多 ()

抢沙发

评论前必须登录!