zoukankan      html  css  js  c++  java
  • 【SAS NOTE】tabulate

     1 data mysas.mms;
     2     infile 'E:\SAS\mysas\mms.txt' dlm='09'x firstobs=2;
     3     input date city wangnei wangjian guoji shangxing wangneid wangjiand guojid 
     4           alld allwangnei allwangjian allguoji allall upfeetiao downfeetiao;
     5     run;
     6 proc print data=mysas.mms;
     7 run;
     8 proc tabulate data=mysas.mms;
     9     class date;
    10     var wangnei;
    11     table date all,sum*wangnei*ALL;
    12 run;

    tabulate过程可以用于生成交叉表,列联表,其中变量可以进行运算。注意 table后的变量顺序是页,行,列,并且中间用逗号隔开。

     --------------------------------------
                                    |                       |    Sum     |
                                    |                       |------------|
                                    |                       |  wangnei   |
                                    |                       |------------|
                                    |                       |    All     |
                                    |-----------------------+------------|
                                    |date                   |            |
                                    |-----------------------|            |
                                    |201207                 | 36452433.00|
                                    |-----------------------+------------|
                                    |201208                 | 31663842.00|
                                    |-----------------------+------------|
                                    |201209                 | 34185344.00|
                                    |-----------------------+------------|
                                    |201210                 | 38972453.00|
                                    |-----------------------+------------|
                                    |201211                 | 33754486.00|
                                    |-----------------------+------------|
                                    |201212                 | 45384882.00|
                                    |-----------------------+------------|
                                    |All                    |1998704690.0|
                                    --------------------------------------

  • 相关阅读:
    使用auto_prepend_file和auto_append_file
    maven导入外部jar包的方法
    scala的多种集合的使用(3)之遍历集合的方法
    scala的多种集合的使用(4)之列表List(ListBuffer)的操作
    scala的多种集合的使用(2)之集合常用方法
    UltraEdit文本行数多变一和一边多
    scala的多种集合的使用(1)之集合层级结构与分类
    用Case类生成模板代码
    寻:IE总弹出广告窗口方法? Hello
    ASP.net中提示"分析器错误""未能加载类型" Hello
  • 原文地址:https://www.cnblogs.com/colipso/p/2878025.html
Copyright © 2011-2022 走看看