SAS中的不良事件表

时间:2019-07-02 21:15:10

标签: arrays loops sas

我有以下SAS数据集:

Subject        AETERM1        AETERM2         TREATMENT
001            Illness        Fever           0
001            Illness        Cold            0
002            Cardiac        AFIB            1
003            Cardiac        AFLUT           1

我想在SAS中创建一个这样的表:

___________________________________________________________________________________________________
    AETERM1
       AETERM2            TREATMENT = 0 (N = 1)     TREATMENT = 1 (N = 2)    OVERALL (N = 3)
__________________________________________________________________________________________________
Any Event                 1 (100%)                  2 (100%)                  3 (100%)
Illness                   1 (100%)                                            1 (33%)
    Fever                 1 (100%)                                            1 (33%)
    Cold                  1 (100%)                                            1 (33%)
Cardiac                                              2 (100%)                 2 (67%)
    AFIB                                             1 (50%)                  1 (33%)   
    AFLUT                                            1 (50%)                  1 (33%) 

我可以使用以下PROC FREQ语句生成一些内容:

proc freq data = have order = freq;
table aeterm1 * aeterm2 / missing;
run;

1 个答案:

答案 0 :(得分:2)

您实际上可以使用

proc freq data = have order = freq;
  table aeterm1 * aeterm2 * treatment / out = results;
run;

并处理results数据集以获得所需的视图