SAS program template created by SapMaker Table 3.4 for Table of Subject Disposition – Example One. Please comment on it or post your other SAS code for table of Subject Disposition.
***************************************************************************************
*** Program Purpose: Create Table DS 1 – Subject Disposition (Format 1)
*** SAS Dataset Used: , DS
*** 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);
%SumStatCatVar(
VarName=RANDSUB,
VarLabel=%bquote(Randomized Subjects, n(%)),
CategoryName=%bquote(Y),
CategoryFormat=%str(),
CategoryOrder=%str(1),
Treatment=TRTGRPC,
ByGroup=%str(),
Population=,
CohortDataset=,
AnalysisDataset=DS,
OutDataset=Sum_RANDSUB,
OutVariable=%str(LabelCol_1, Col_1, Col_2, Col_3),
Usubjid=USUBJID,
DatasetOrder=1
);
%SumStatCatVar(
VarName=COMPLETR,
VarLabel=%bquote(Completed Study, n(%)),
CategoryName=%bquote(Y),
CategoryFormat=%str(),
CategoryOrder=%str(1),
Treatment=TRTGRPC,
ByGroup=%str(),
Population=,
CohortDataset=,
AnalysisDataset=DS,
OutDataset=Sum_COMPLETR,
OutVariable=%str(LabelCol_1, Col_1, Col_2, Col_3),
Usubjid=USUBJID,
DatasetOrder=2
);
%SumStatCatVar(
VarName=DSREAS,
VarLabel=%bquote(Reason for Withdrawal),
CategoryName=%bquote(ADVERSE EVENT, SUBJECT CHOICE, LOST TO FOLLOW-UP, OTHERS),
CategoryFormat=%str(3.0, 3.0, 3.0, 3.0),
CategoryOrder=%str(1, 2, 3, 4),
Treatment=TRTGRPC,
ByGroup=%str(),
Population=,
CohortDataset=,
AnalysisDataset=DS,
OutDataset=Sum_DSREAS,
OutVariable=%str(LabelCol_1, Col_1, Col_2, Col_3),
Usubjid=USUBJID,
DatasetOrder=3
);
data Sum_RANDSUB;
merge Sum_RANDSUB Test_RANDSUB;
by _setorder _varorder;
run;
data Sum_COMPLETR;
merge Sum_COMPLETR Test_COMPLETR;
by _setorder _varorder;
run;
data rptSet;
set
Sum_RANDSUB
Sum_COMPLETR
Sum_DSREAS
;
run;
*** Proc Printto file =” ” new; run;
title1 “Table DS 1”;
title2 “Subject Disposition (Format 1)”;
title3 “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);
run;
footnote1 “&f1”;
footnote2 “&f2″;
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=20 left flow “Disposition/Reasons#__”;
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;