%aetab

Last updated: 19 Dec 2011

Introduction

The %aetab macro was planned, designed and written near the end of 2011 to address the limitation of the three-level AE reporting maximum of %npcttab. Four level reporting is sometimes required and this was not possible with the %npcttab macro due to its design limitations so %aetab was created to handle an unlimited level of reporting.

Probably, five level reporting is the most useful for AE reporting when you consider the levels in AE reporting namely "System Organ Class", "High Level Group Term", "High Level Term", "Preferred Term" and "Intensity". The higher the level you have counts and percentages for, for different treatment regimens, the more significant are the differences between drug adverse events between treatment arms that could be used in statistical analysis. Other low levels you might want to display are "outcome" and "hospitalisation".

It is not clear why AE reporting is limited to only a few levels within most pharmaceutical companies. This could be due to the complexity of the software. Considering that my own %npcttab macro has become overly complicated and difficult to work on then this is a possible reason.

Part of the rethink of the %npcttab macro and the design of the %aetab macro was to split out the processing and make it more generic with no limitations assumed for the number of levels of reporting. To this end I split up the conceptual elements into the "levels" macros. There is a %freqlvls macro for calculating _FREQ_ counts, a %trnslvls macro for transposing these frequency counts by treatment group, a %comblvls macro for combining the text of the different levels and finally a %prntlvls macro for printing them.

In 2011, the %aetab macro is still relatively new. It has fewer parameters than %npcttab and is relatively easier to learn and understand. Because of this, I will leave it to the reader to learn more about its functionality from the macro header and in what follows below I will show you only a limited use of the %aetab macro. To learn more, you will have to read the macro header and try out your own test programs. You can link to the macro here.

%npcttab vs. %aetab

The "pros" of %aetab when compared to %npcttab is that it can handle an unlimited level of AE reporting (9 levels is the practical limit currently but can easily be increased if required). The "cons" are that it lacks some of the functionality of %npcttab. %aetab can calculate p-values in the same way %npcttab does but it chooses between the Chi Squared and the Fisher Exact test automatically based on expected cell counts.

More of the functionality of %npcttab will be added to %aetab but this will take some time and needs to be prioritized by user requests.

%aetab uses a "shared column" method of reporting corresponding to style=3 for %npcttab. %aetab has only this one style. This style is only suitable for ascii reports due to the use of split characters in the column values. Note that this style will only work for European character sets such that the letters are encoded in single bytes.

The face off

Here you will see the output of %npcttab and %aetab compared, You will see that %aetab is a little bit more powerful in that it generates values for the summation of every level. You will also see that it can be "dumbed down" to make it look like %npcttab.

At some time in the future, %aetab might take over from %npcttab. It is a redesign and the code is much better but this isn't going to happen soon - if at all.

So we have code here that you can run and see the output and I recommend you run the code yourself if you are able. It will produce three outputs which will be shown below.
 
options noovp nodate nonumber nocenter missing=" " formchar='|_---|+|---+=|-/\<>*' 
sasautos=("C:\spectre\macros" SASAUTOS) ls=90 ps=63; 
title1; 

proc format; 
  value trtnarr 
  1="Ambident@(1g/day)" 
  2="Betamax@(500mg/day)" 
  3="No@treatment" 
  ; 
run; 

proc sort data=sasuser.demog(where=(fascd=1)) 
           out=demog(drop=fascd); 
  by patno invid; 
run; 

%popfmt(demog,trtcd,uniqueid=patno invid,trtfmt=trtnarr.) 

proc sort data=sasuser.adv 
           out=adv; 
  by patno invid; 
run; 

data adv; 
  merge demog(in=_dem keep=patno invid trtcd) adv(in=_adv); 
  by patno invid; 
  if _dem and _adv; 
  label amsoc="System Organ Class" 
        ampt="Preferred Term" 
  ; 
run; 

*- %npcttab style=3 report -; 
%npcttab(dsin=adv,midlvl=amsoc,lowlvl=ampt,style=3,pvalues=yes); 

*- %aetab with the highest summation -; 
%aetab(dsin=adv,varlist=amsoc ampt,colw=33,pvalues=yes); 

*- %aetab made to look like %npcttab style=3 by dropping the highest summation -; 
%aetab(dsin=adv,varlist=amsoc ampt,colw=33,lvl1anylbl=" ",pvalues=yes);
 

This is the %npcttab style=3 output.
 
__________________________________________________________________________________________

                                      Ambident        Betamax
System Organ Class                    (1g/day)      (500mg/day)       Total
   Preferred Term                       (N=9)          (N=8)         (N=17)       p-value
__________________________________________________________________________________________

Gastrointestinal disorders             7 ( 77.8)      8 (100.0)     15 ( 88.2)     0.471^
   Constipation                        4 ( 44.4)      5 ( 62.5)      9 ( 52.9)     0.637^
   Nausea                              3 ( 33.3)      6 ( 75.0)      9 ( 52.9)     0.153^
   Abdominal pain NOS                  2 ( 22.2)      6 ( 75.0)      8 ( 47.1)     0.057^
   Diarrhoea NOS                       2 ( 22.2)      6 ( 75.0)      8 ( 47.1)     0.057^
   Vomiting NOS                        2 ( 22.2)      3 ( 37.5)      5 ( 29.4)     0.620^

General disorders and                  6 ( 66.7)      5 ( 62.5)     11 ( 64.7)    >0.999^
administration site conditions
   Chest pain                          5 ( 55.6)      4 ( 50.0)      9 ( 52.9)    >0.999^
   Pain NOS                            2 ( 22.2)      3 ( 37.5)      5 ( 29.4)     0.620^

Psychiatric disorders                  4 ( 44.4)      7 ( 87.5)     11 ( 64.7)     0.131^
   Insomnia                            4 ( 44.4)      7 ( 87.5)     11 ( 64.7)     0.131^
   Anxiety                             2 ( 22.2)      3 ( 37.5)      5 ( 29.4)     0.620^

Musculoskeletal and connective         4 ( 44.4)      6 ( 75.0)     10 ( 58.8)     0.335^
tissue disorders
   Pain in extremity                   3 ( 33.3)      5 ( 62.5)      8 ( 47.1)     0.347^
   Back pain                           3 ( 33.3)      4 ( 50.0)      7 ( 41.2)     0.637^

Respiratory, thoracic and              5 ( 55.6)      5 ( 62.5)     10 ( 58.8)    >0.999^
mediastinal disorders
   Cough                               4 ( 44.4)      4 ( 50.0)      8 ( 47.1)    >0.999^
   Dyspnoea                            3 ( 33.3)      3 ( 37.5)      6 ( 35.3)    >0.999^

Vascular disorders                     5 ( 55.6)      5 ( 62.5)     10 ( 58.8)    >0.999^
   Hypotension NOS                     4 ( 44.4)      5 ( 62.5)      9 ( 52.9)     0.637^
   Hypertension NOS                    2 ( 22.2)      2 ( 25.0)      4 ( 23.5)    >0.999^

Nervous system disorders               2 ( 22.2)      5 ( 62.5)      7 ( 41.2)     0.153^
   Headache                            2 ( 22.2)      5 ( 62.5)      7 ( 41.2)     0.153^
   Tremor                              2 ( 22.2)      2 ( 25.0)      4 ( 23.5)    >0.999^

 

This is the default %aetab output. Note that you must specify a column width for %aetab. The difference between the %npcttab and %aetab output is that there is an overall total for all patients that is automatically generated.
 
__________________________________________________________________________________________

                                      Ambident        Betamax
System Organ Class                    (1g/day)      (500mg/day)       Total
   Preferred Term                       (N=9)          (N=8)         (N=17)       p-value
__________________________________________________________________________________________

Patients with any Adverse Event        7 ( 77.8)      8 (100.0)     15 ( 88.2)     0.471^

Gastrointestinal disorders             7 ( 77.8)      8 (100.0)     15 ( 88.2)     0.471^
   Constipation                        4 ( 44.4)      5 ( 62.5)      9 ( 52.9)     0.637^
   Nausea                              3 ( 33.3)      6 ( 75.0)      9 ( 52.9)     0.153^
   Abdominal pain NOS                  2 ( 22.2)      6 ( 75.0)      8 ( 47.1)     0.057^
   Diarrhoea NOS                       2 ( 22.2)      6 ( 75.0)      8 ( 47.1)     0.057^
   Vomiting NOS                        2 ( 22.2)      3 ( 37.5)      5 ( 29.4)     0.620^

General disorders and                  6 ( 66.7)      5 ( 62.5)     11 ( 64.7)    >0.999^
administration site conditions
   Chest pain                          5 ( 55.6)      4 ( 50.0)      9 ( 52.9)    >0.999^
   Pain NOS                            2 ( 22.2)      3 ( 37.5)      5 ( 29.4)     0.620^

Psychiatric disorders                  4 ( 44.4)      7 ( 87.5)     11 ( 64.7)     0.131^
   Insomnia                            4 ( 44.4)      7 ( 87.5)     11 ( 64.7)     0.131^
   Anxiety                             2 ( 22.2)      3 ( 37.5)      5 ( 29.4)     0.620^

Musculoskeletal and connective         4 ( 44.4)      6 ( 75.0)     10 ( 58.8)     0.335^
tissue disorders
   Pain in extremity                   3 ( 33.3)      5 ( 62.5)      8 ( 47.1)     0.347^
   Back pain                           3 ( 33.3)      4 ( 50.0)      7 ( 41.2)     0.637^

Respiratory, thoracic and              5 ( 55.6)      5 ( 62.5)     10 ( 58.8)    >0.999^
mediastinal disorders
   Cough                               4 ( 44.4)      4 ( 50.0)      8 ( 47.1)    >0.999^
   Dyspnoea                            3 ( 33.3)      3 ( 37.5)      6 ( 35.3)    >0.999^

Vascular disorders                     5 ( 55.6)      5 ( 62.5)     10 ( 58.8)    >0.999^
   Hypotension NOS                     4 ( 44.4)      5 ( 62.5)      9 ( 52.9)     0.637^
   Hypertension NOS                    2 ( 22.2)      2 ( 25.0)      4 ( 23.5)    >0.999^

Nervous system disorders               2 ( 22.2)      5 ( 62.5)      7 ( 41.2)     0.153^
   Headache                            2 ( 22.2)      5 ( 62.5)      7 ( 41.2)     0.153^
   Tremor                              2 ( 22.2)      2 ( 25.0)      4 ( 23.5)    >0.999^
 

And in the third case, %aetab has been asked to work like the %npcttab macro by suppressing the highest level summation by setting the label to a space.
 
__________________________________________________________________________________________

                                      Ambident        Betamax
System Organ Class                    (1g/day)      (500mg/day)       Total
   Preferred Term                       (N=9)          (N=8)         (N=17)       p-value
__________________________________________________________________________________________

Gastrointestinal disorders             7 ( 77.8)      8 (100.0)     15 ( 88.2)     0.471^
   Constipation                        4 ( 44.4)      5 ( 62.5)      9 ( 52.9)     0.637^
   Nausea                              3 ( 33.3)      6 ( 75.0)      9 ( 52.9)     0.153^
   Abdominal pain NOS                  2 ( 22.2)      6 ( 75.0)      8 ( 47.1)     0.057^
   Diarrhoea NOS                       2 ( 22.2)      6 ( 75.0)      8 ( 47.1)     0.057^
   Vomiting NOS                        2 ( 22.2)      3 ( 37.5)      5 ( 29.4)     0.620^

General disorders and                  6 ( 66.7)      5 ( 62.5)     11 ( 64.7)    >0.999^
administration site conditions
   Chest pain                          5 ( 55.6)      4 ( 50.0)      9 ( 52.9)    >0.999^
   Pain NOS                            2 ( 22.2)      3 ( 37.5)      5 ( 29.4)     0.620^

Psychiatric disorders                  4 ( 44.4)      7 ( 87.5)     11 ( 64.7)     0.131^
   Insomnia                            4 ( 44.4)      7 ( 87.5)     11 ( 64.7)     0.131^
   Anxiety                             2 ( 22.2)      3 ( 37.5)      5 ( 29.4)     0.620^

Musculoskeletal and connective         4 ( 44.4)      6 ( 75.0)     10 ( 58.8)     0.335^
tissue disorders
   Pain in extremity                   3 ( 33.3)      5 ( 62.5)      8 ( 47.1)     0.347^
   Back pain                           3 ( 33.3)      4 ( 50.0)      7 ( 41.2)     0.637^

Respiratory, thoracic and              5 ( 55.6)      5 ( 62.5)     10 ( 58.8)    >0.999^
mediastinal disorders
   Cough                               4 ( 44.4)      4 ( 50.0)      8 ( 47.1)    >0.999^
   Dyspnoea                            3 ( 33.3)      3 ( 37.5)      6 ( 35.3)    >0.999^

Vascular disorders                     5 ( 55.6)      5 ( 62.5)     10 ( 58.8)    >0.999^
   Hypotension NOS                     4 ( 44.4)      5 ( 62.5)      9 ( 52.9)     0.637^
   Hypertension NOS                    2 ( 22.2)      2 ( 25.0)      4 ( 23.5)    >0.999^

Nervous system disorders               2 ( 22.2)      5 ( 62.5)      7 ( 41.2)     0.153^
   Headache                            2 ( 22.2)      5 ( 62.5)      7 ( 41.2)     0.153^
   Tremor                              2 ( 22.2)      2 ( 25.0)      4 ( 23.5)    >0.999^
 

Conclusion

You have seen how the %aetab macro with its multi-level reporting capabilities compares with the %npcttab macro at two levels of reporting.