AE by SOC and PT

SAS program template created by SapMaker Table 3.4 for Table of Incidence of Adverse Event by System Organ Class and Preferred Term  – Example One.    Please comment on it or post your other SAS code for table  of Incidence of Adverse Event by System Organ Class and Preferred Term.

***************************************************************************************
*** Program Purpose: Create Table AE 1 – Incidence of Treatment Emergent Adverse Event by Preferred Term and Treatment
*** SAS Dataset Used: , AE
*** Date of Program Created: 8/18/2010
*** Programmer:  SapMaker
***************************************************************************************;

libname sasmacro ‘C:\Program Files\SapMaker\SasMacro’;
options nonumber nodate nofmterr mlogic ls=132 ps=48;
option mstored sasmstore=sasmacro;

/** Count number of subjects in each treatment group and set it to macro variable npt1, npt2, etc. **/
%GroupCount(
CohortDataset=,
Treatment=TRTGRPC,
Usubjid=USUBJID);

%SumIncidentCatVar(
VarName=ANYAESUB,
VarLabel=%bquote(Subjects with  Any Adverse Event, n(%)),
CategoryName=%bquote(Y),
CategoryFormat=%str(),
CategoryOrder=%str(1),
Treatment=TRTGRPC,
ByGroup=%str(),
Population=,
CohortDataset=,
AnalysisDataset=AE,
OutDataset=Sum_ANYAESUB,
OutVariable=%str(LabelCol_1, Col_1, Col_2, Col_3),
Usubjid=USUBJID,
DatasetOrder=1
);

%SumTwoIncidentCatVar(
VarName=AEDECOD,
VarLabel=%bquote(By Preferred Term),
CategoryName=%bquote(Preferred term 1, Preferred term 2, Preferred term 2, Preferred term 3),
CategoryFormat=%str(3.0, 3.0, 3.0, 3.0),
CategoryOrder=%str(1, 2, 3, 4),
Treatment=TRTGRPC,
ByGroup=%str(),
Population=,
CohortDataset=,
AnalysisDataset=AE,
OutDataset=Sum_AEDECOD,
OutVariable=%str(LabelCol_1, Col_1, Col_2, Col_3),
Usubjid=USUBJID,
DatasetOrder=2
);

data rptSet;
set
Sum_ANYAESUB
Sum_AEDECOD
;
run;

*** Proc Printto file =” ” new;  run;

title1 “Table AE 1″;
title2 “Incidence of Treatment Emergent Adverse Event by Preferred Term and Treatment”;
title3  “(Format 1)”;
title4  “All Randomized Subjects”;

data _NULL_;
length ft $132.;
ft=%str(repeat(“_”, 132));
call symput(‘f1′, ft);
ft =%str(“Note: denominator of percentage is the number of subjects in the column”);
call symput(‘f2′, ft);
ft =%str(“Percentage is based on subjects who had events not the number of events.”);
call symput(‘f3′, ft);
run;

footnote1 “&f1″;
footnote2 “&f2″;
footnote3 “&f3″;

Proc Report Data = rptSet  split=”#” spacing =2 nowindows list headskip missing;
Column
_setorder LabelCol_1
( “Placebo#”  Col_1  )
( “Dose 10 mg#”  Col_2  )
( “Dose 100 mg#”  Col_3  ) ;

define _setorder / order order=data noprint;
define LabelCol_1 / display width=15 left flow “Preferred term#__”;
define Col_1 / display width=8 center “(N=%trim(%left(&npt1)))#__”;
define Col_2 / display width=11 center “(N=%trim(%left(&npt2)))#__”;
define Col_3 / display width=12 center “(N=%trim(%left(&npt3)))#__”;

break after _setorder / skip suppress;
run;

Proc Printto; run;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s