用SAS进行数据分析:报表与图形输出过程汇总

报表与图形输出过程汇总。

*Tabulate过程分类汇总;

proc tabulate data=need;

class brand;

var ts9 ts10;

table brand all,(ts9 ts10)*(n sum mean);

keylabel n=”用户数” sum=”发送总量” mean=”人均发送”;

label brand=”品牌” all=”总计” ts9=”9月” ts10=”10月”;

run;

*Means过程输出简单统计量;

proc means data=need n sum mean maxdec=2;

var ts9 ts10;

label ts9=”9月” ts10=”10月”;

run;

*Univariate过程输出简单统计量;

proc univariate data=need;

var ts10;

run;

*Freq过程输出离散变量分布情况;

proc freq data=need;

tables brand sex;

run;

*Corr过程计算两变量之间的相关关系;

proc corr data=need;

var ts10 ts9 fee10 fee9;

run;

*Gplot绘制散点图和曲线图;

proc gplot data=need;

symbol i=none v=* color=blue;

plot ts10*ts9;

quit;

proc gplot data=need;

symbol i=join v=* color=blue;

plot ts10*ts9;

quit;

*绘制直方图;

goptions reset=goptions;

proc gchart data=need;

vbar sex;

quit;

*绘制三维直方图;

proc gchart data=need;

vbar3d sex;

quit;

*绘制横向直方图;

proc gchart data=need;

hbar sex;

quit;

*绘制三维横向直方图;

proc gchart data=need;

hbar3d sex;

quit;

*绘制饼形图;

proc gchart data=need;

pie sex/type=percent;

run;

*绘制三维饼形图;

proc gchart data=need;

pie3d sex/type=percent;

run;

*绘制环形饼形图;

proc gchart data=need;

donut sex/type=percent;

run;

*绘制三角形面积图;

proc gchart data=need;

star sex/type=percent;

run;

*绘制三维分类直方图;

proc gchart data=need;

block sex/group=brand;

quit;

*G3D过程用来绘制三维曲面;

data test;

do x=-3 to 3 by 0.1;

do y=-3 to 3 by 0.1;

z=x**2+y**2;

output;

end;

end;

run;

proc g3d data=test;

plot x*y=z;

run;

*GCONTOUR过程则是画出曲面的等高线图;

proc gcontour data=test;

plot x*y=z;

run;

本文为专栏文章,来自:郑来轶,内容观点不代表本站立场,如若转载请联系专栏作者,本文链接:https://www.afenxi.com/1497.html 。

(0)
郑来轶的头像郑来轶专栏
上一篇 2015-11-01 22:38
下一篇 2015-11-03 22:36

相关文章

关注我们
关注我们
分享本页
返回顶部