SAS program template created by SapMaker Table 3.4 for Table of Change from Baseline in Efficacy – Example One. Please comment on it or post your other SAS code for table of Change from Baseline in Efficacy.
***************************************************************************************
*** Program Purpose: Create Table EFF 4 – Summary of Change from Baseline of Efficacy Endpoint (Form 2)
*** SAS Dataset Used: , EF
*** Date of Program Created: 8/18/2010
*** Programmer: SapMaker
***************************************************************************************;
libname 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);
%SumStatCntVar(
VarName=EFFBASE,
VarLabel=%bquote(Baseline),
SumStatName=%bquote(n, Mean, SD, Median, Range),
SumStatFormat=%str(3.0, 3.0, 4.2, 3.0, 3.0),
SumStatOrder=%str(1, 2, 3, 4, 5),
Treatment=TRTGRPC,
ByGroup=%str(),
Population=,
CohortDataset=,
AnalysisDataset=EF,
OutDataset=Sum_EFFBASE,
OutVariable=%str(LabelCol_1),
DatasetOrder=1
);
%SumStatCntVar(
VarName=EFFEXM,
VarLabel=%bquote(Primary Efficacy Exam Visit),
SumStatName=%bquote(n, Mean, SD, Median, Range),
SumStatFormat=%str(3.0, 3.0, 4.2, 3.0, 3.0),
SumStatOrder=%str(1, 2, 3, 4, 5),
Treatment=TRTGRPC,
ByGroup=%str(),
Population=,
CohortDataset=,
AnalysisDataset=EF,
OutDataset=Sum_EFFEXM,
OutVariable=%str(LabelCol_1),
DatasetOrder=2
);
%SumStatCntVar(
VarName=EFFCFB,
VarLabel=%bquote(Change from Baseline to Exam Visit),
SumStatName=%bquote(n, LS-Mean (b), SE, 95% CI (b)),
SumStatFormat=%str(3.0, 3.0, 3.1, 5.1),
SumStatOrder=%str(1, 2, 3, 4),
Treatment=TRTGRPC,
ByGroup=%str(),
Population=,
CohortDataset=,
AnalysisDataset=EF,
OutDataset=Sum_EFFCFB,
OutVariable=%str(LabelCol_1),
DatasetOrder=3
);
%ANCOVA(
VarName=EFFBASE,
Treatment=TRTGRPC,
AnalysisDataset=EF,
OutDataset=Test_EFFBASE,
OutVariable=%str(ExtCol_1),
CohortDataset=,
Population=,
Catcovariate=%str(),
Cntcovariate=%str(),
TestOutputName=%str(p-value),
TestOutputFormat=%str(5.3),
TestOutputPosition=%str(2),
DatasetOrder=1
);
%ANCOVA(
VarName=EFFEXM,
Treatment=TRTGRPC,
AnalysisDataset=EF,
OutDataset=Test_EFFEXM,
OutVariable=%str(ExtCol_1),
CohortDataset=,
Population=,
Catcovariate=%str(),
Cntcovariate=%str(),
TestOutputName=%str(p-value),
TestOutputFormat=%str(5.3),
TestOutputPosition=%str(2),
DatasetOrder=2
);
%ANCOVA(
VarName=EFFCFB,
Treatment=TRTGRPC,
AnalysisDataset=EF,
OutDataset=Test_EFFCFB,
OutVariable=%str(ExtCol_1),
CohortDataset=,
Population=,
Catcovariate=%str(),
Cntcovariate=%str(),
TestOutputName=%str(p-value),
TestOutputFormat=%str(5.3),
TestOutputPosition=%str(2),
DatasetOrder=3
);
data Sum_EFFBASE;
merge Sum_EFFBASE Test_EFFBASE;
by _setorder _varorder;
run;
data Sum_EFFEXM;
merge Sum_EFFEXM Test_EFFEXM;
by _setorder _varorder;
run;
data Sum_EFFCFB;
merge Sum_EFFCFB Test_EFFCFB;
by _setorder _varorder;
run;
data rptSet;
set
Sum_EFFBASE
Sum_EFFEXM
Sum_EFFCFB
;
run;
*** Proc Printto file =” ” new; run;
title1 “Table EFF 4”;
title2 “Summary of Change from Baseline of Efficacy Endpoint (Form 2) “;
title3 “Efficacy Analysis Population”;
data _NULL_;
length ft $132.;
ft=%str(repeat(“_”, 132));
call symput(‘f1’, ft);
ft =%str(“(a) From Kreski-Wallis test.”);
call symput(‘f2’, ft);
ft =%str(“(b) From ANOVA test with site as a fact and baseline exam value as a covariate.”);
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
ExtCol_1 ;
define _setorder / order order=data noprint;
define LabelCol_1 / display width=17 left flow “Primary Endpoint#__”;
define ExtCol_1 / display width=8 center “p-value#__”;
break after _setorder / skip suppress;
run;
Proc Printto; run;