*************************************************************************************************; * CLIENT: ModernaTX, Inc. * PROTOCOL: mRNA-1273-P301 * PURPOSE: Create Inferential Statistical Analysis Macro * INPUT FILES: ADaM datasets * OUTPUT FILES: *.rtf * USAGE NOTES: *************************************************************************************************; * Copyright 2020 Pharmaceutical Product Development, Inc. * All Rights Reserved. *************************************************************************************************; %macro GMT_GMR_CI (lib=, datain=, subset=, trt=, cohort=, dataout=, grvar=); data is; set &lib..&datain.; where &subset.; run; data temp; set is; length trt $20; trt=&trt.; output; if index(&trt., 'mRNA-1273')>0 then trt='mRNA-1273 Total'; output; run; data temp1; set temp; length cohort $20; cohort=&cohort.; output; if &cohort.^='' then cohort='Overall'; output; if &cohort.='' then cohort='Missing'; output; run; proc sort data=temp1 out=n1 nodupkey; by subjid trt cohort paramcd avisit &grvar.; where ; run; proc means data=n1 n mean lclm uclm alpha=0.05; var AVAL CHG; class trt cohort PARAM PARAMCD AVISIT &grvar.; ods output summary=summary1; run; data &dataout.1; set summary1; if AVAL_Mean^=. then GMT=10**AVAL_Mean; if AVAL_LCLM^=. then LOWERGMT=10**AVAL_LCLM; if AVAL_UCLM^=. then UPPERGMT=10**AVAL_UCLM; if CHG_MEAN^=. then GMR=10**CHG_MEAN; if CHG_LCLM^=. then LOWERGMR=10**CHG_LCLM; if CHG_UCLM^=. then UPPERGMR=10**CHG_UCLM; keep trt cohort /*param*/ paramcd avisit &grvar. gmt LOWERGMT UPPERGMT gmr LOWERGMR UPPERGMR; run; proc sort data= &dataout.1; by paramcd; run; proc sort data= adb.&datain. out=adiso(keep=paramcd param) nodupkey; by paramcd; run; Data &dataout.; merge &dataout.1(in=a) adiso; by paramcd; if a; Run; %mend GMT_GMR_CI;