- 阅读权限
- 26
- 威望
- 0 级
- 论坛币
- 3685 个
- 学术水平
- 1 点
- 热心指数
- 5 点
- 信用等级
- 1 点
- 经验
- 20223 点
- 帖子
- 200
- 精华
- 0
- 在线时间
- 235 小时
- 注册时间
- 2016-3-26
- 最后登录
- 2018-4-23
- 答疑数
- 9
|
本帖最后由 坚持坚持lwb 于 2018-1-13 18:07 编辑
/*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;
|
|