简体   繁体   English

SAS proc频率表

[英]SAS proc freq table

I need help in sas proc freq table. 我在sas proc freq表中需要帮助。

I have two columns : TYPE and STATUS 我有两列:TYPE和STATUS

TYPE has two values : TypeA and TypeB STATUS has two values : ON and OFF TYPE具有两个值:TypeA和TypeB STATUS具有两个值:ON和OFF

I need the sas proc freq table output as follows : 我需要如下的sas proc freq表输出:

--------------------------------------------------
| TYPE |         STATUS      |
--------------------------------------------------
|      | ON | OFF | ON | OFF |

--------------------------------------------------
| TypeA| 33 | 44 | 22  | 55  |
--------------------------------------------------
| TypeB| 11 | 22 | 33  | 44  | 
--------------------------------------------------

How can I obtain this ? 我如何获得呢? I have tried: 我努力了:

proc freq data = XYZ; 
tables TYPE*STATUS/missing nocol norow nopercent nocum; 
run; 

PROC TABULATE is probably the easiest way to get that total column. PROC TABULATE可能是获取总列的最简单方法。 The keyword all gives you a total across a class. 关键字all为您提供整个课程的总和。

proc tabulate data=xyz;
class type status;
tables type,(status all)*n;
run;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM