BookmarkSubscribeRSS Feed
devarayalu
Fluorite | Level 6

Hi every one?

Can any one help?

AE_CONTTBL

ORD    AECAT                    TRT OUTCOME   FREQ

1     Any TEAE                     1      1        17

1     Any TEAE                     1      2        23

1     Any TEAE                      2     1           13

1     Any TEAE                      2      2        52

2     Drug-Related TEAE         1      1         4

2     Drug-Related TEAE         1        2      36

2     Drug-Related TEAE                       2        1         6

2     Drug-Related TEAE                       2        2 59

3     Grade 3 or Higher TEAE                  1        1         3

3     Grade 3 or Higher TEAE                  1        2 37

3     Grade 3 or Higher TEAE                  2        1         1

3     Grade 3 or Higher TEAE                  2        2 64

4     Grade 3 or Higher Drug-Related TEAE     1 1         2

4     Grade 3 or Higher Drug-Related TEAE     1 2        38

4     Grade 3 or Higher Drug-Related TEAE     2 1         1

4     Grade 3 or Higher Drug-Related TEAE     2 2        64

5     Serious Adverse Event                   1 1         3

5     Serious Adverse Event                   1        2 37

5     Serious Adverse Event                   2        1         2

5     Serious Adverse Event                   2        2 63

6     On-study Death                          1        1         1

6     On-study Death                          1        2 39

6     On-study Death                          2        1         0

6     On-study Death                          2        2 65

Required Output:



3 REPLIES 3
Cynthia_sas
Diamond | Level 26

Hi:

  I don't see the p-value numbers in your data, plus, it looks like you have more rows (4) per category, so how do you distinguish the logic for which rows should be created?

  If you work for a Pharmaceutical company or CRO, it has been my experience that folks either use DATA step programs to generate this report and/or they use PROC REPORT because of the need to get the N (PCTN) construct in one column. Every company has a slightly different twist. My paper "Creating Complex Reports" shows an example of how to do this type of report with both PROC REPORT and DATA step.

  But, there have been PharmaSUG papers that discuss how to generate this type of report. I would recommend that you start with resources inside your own company. You're not programming this in a vacuum. The Adverse Event type of table is a well-documented table. How you produce it will depend on the standards within your company. I would recommend that you look at other studies to see how they produced their AE reports (in addition to looking for PharmaSUG papers. If you go to www.lexjansen.com, you can search an index of all user group papers, including PharmaSUG papers.

cynthia

art297
Opal | Level 21

Sure looks like homework to me.  Correct me if I'm wrong but, in case I'm not, I'll just lead you in the right direction.

Your output table sure looks like it contains the results one would obtain from running proc freq on your data.  e.g.:

proc freq data=ae_conttbl order=data;

  tables aecat*outcome*trt/chisq nocum nopercent norow;

  weight freq;

run;

Ksharp
Super User

OK. How About:

data x;
input ORD    AECAT    & $40.                TRT OUTCOME   FREQ ;
cards;
1     Any TEAE                     1      1        17
1     Any TEAE                     1      2        23
1     Any TEAE                      2     1           13
1     Any TEAE                      2      2        52
2     Drug-Related TEAE         1      1         4
2     Drug-Related TEAE         1        2      36
2     Drug-Related TEAE                       2        1         6
2     Drug-Related TEAE                       2        2 59
3     Grade 3 or Higher TEAE                  1        1         3
3     Grade 3 or Higher TEAE                  1        2 37
3     Grade 3 or Higher TEAE                  2        1         1
3     Grade 3 or Higher TEAE                  2        2 64
4     Grade 3 or Higher Drug-Related TEAE     1 1         2
4     Grade 3 or Higher Drug-Related TEAE     1 2        38
4     Grade 3 or Higher Drug-Related TEAE     2 1         1
4     Grade 3 or Higher Drug-Related TEAE     2 2        64
5     Serious Adverse Event                   1 1         3
5     Serious Adverse Event                   1        2 37
5     Serious Adverse Event                   2        1         2
5     Serious Adverse Event                   2        2 63
6     On-study Death                          1        1         1
6     On-study Death                          1        2 39
6     On-study Death                          2        1         0
6     On-study Death                          2        2 65
;
run;

proc sql;
create table temp as
select  AECAT,catt(freq,' (',put(freq/sum(freq)*100,f4.1),')') as per length=20 
 from x
   group by  AECAT,TRT 
    having OUTCOME=1;quit;
proc transpose data=temp out=want(drop=_name_);
 by  AECAT;
 var per;
run;

proc freq data=x;
tables AECAT*trt*outcome / fisher;
output out=ChiSqData(keep=AECAT XP2_FISH) n fisher;
weight freq;
run;

data want;
 merge want ChiSqData;
 by  AECAT;
 label AECAT='Category' col1='Control (N=40)' col2='Active (N=65)';
run;

proc print label noobs;run;

Ksharp

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1356 views
  • 0 likes
  • 4 in conversation