SAS进阶《深入分析SAS》之数据汇总和展现

1. 通过Print过程制作报表

proc print <data=数据集>;
run;
选项:
obs=修改观测序号列标签
noobs不显示观测序列号
id语句在输出中取代观测序列
var选择输出的变量
where语句选择输出的观测 总结如下:
proc print data=数据集<选项>;
id 变量1<变量2...>;
var 变量1<变量2...>;
where 表达式;
sum 变量1 <变量2...>;
where 表达式;
sum 变量1<变量2...>;
sumby 变量1<变量2...>;
run;

2. tabulate

proc tabulate data=Saslib.Sales2;
title1 'Sales in North America';
title2 'TOtal Transactions';
/*
*class为分类变量
*/
class Emp_ID Dept;
var Sales;
table Dept*Emp_ID,Sales;
run;

3. 通过GPLOT过程制作图行

分组变量

    axis1 order=(18900 to 18960 by 5);
axis2 order=(9000 to 20000 by 1000);
minor=(color=blue height=0.25 number=1);
symbol value=# cv=red
interpol=join ci=blue;
proc gplot data = Saslib.Sales;
title f = 'Albany Amt' c = blue h = 3 u = 2 'Yearly Amount in North America';
footnote j = r 'Optimization Solution Co.Ltd';
plot Sales*Date=Emp_ID/haxis=axis1 vaxis=axis2;
run;
quit;
goptions reset=all;

4. 增强型HTLM输出

    proc sort data=sashelp.prdsale out=work.prdsale;
by country;
run;
ods html path="C:\Users\LEI\Desktop\data"
body='prdsalebody.html'
frame='prdsaleframe.html'
contents='prdsalecontents.html'; proc tabulate data=work.prdsale;
class region division prodtype;
var actual;keyword all sum;
keylabel all='Total';
table (region all)*(division all),
(prodtype all)*(actual*f=dollar10.) / misstext=[label='Missing']
box=[label='Region by Division and Type'];
run; ods select ExtremeObs Quantiles Moments;
proc univariate data=work.prdsale;
by Country;
var actual;
run; ods html close;

总结:SAS对数据的汇总和表现两种方式:一种是列表,一种是图行。通过print和tabulate过程制作各种报表和汇总报表;GPLOT过程和GCHART过制作散点图、连线图、气泡图、柱状图等多种图行;ODS输出传送系统,包括如何选择或挑剔输出对象,创建多种格式的输出文件。

最新文章

  1. iOS学习-UIButton的imageView和titleLabel
  2. ajax之 get post请求
  3. 从零开始学习Node.js例子八 使用SQLite3和MongoDB
  4. C++编写DLL的方法
  5. Mysql 5.7.12解压版的安装及配置系统编码
  6. POJ 1925 Spiderman
  7. 新浪微博授权失败:applications over the unaudited use restrictions
  8. PHP slim restfull框架nginx 配置
  9. Oracle分页查询语句
  10. Codeforces Round #254DIV2
  11. java System 常用方法
  12. 三种常见字符编码简介:ASCII、Unicode和UTF-8
  13. 快速了解常用XHTML基础
  14. web项目中获取各种路径的方法
  15. 远程登录Linux服务器修改ssh端口
  16. PowerShell: 问题,此系统上禁止运行脚本解决方法
  17. MVVMLight 1:MVVMLight介绍以及在项目中的使用
  18. Ajax简单总结
  19. Go中链路层套接字的实践
  20. ACM知识点总结

热门文章

  1. muduo buffer类的设计与使用
  2. NA路由②
  3. centos 建立Clamav自动扫描脚本
  4. 从头认识Spring-2.3 注解装配-@autowired(4)-required(2)
  5. Linux---有关dig命令的有用脚本
  6. 杭电 3555 Bomb
  7. ZOJ 3819 Average Score 水
  8. Justinmind使用教程(2)——计算表达式及条件用法
  9. easyui报错“Cannot read poperty &#39;options&#39; of undefined”问题解决方案之一
  10. FreeRTOS系列第14篇---FreeRTOS任务通知