Source
xxxxxxxxxx
title =%quote(Table 1&tableletter.. &aggregated.Adjusted Characteristics of &grouplabel. (Propensity Score Matched&dpcomma., &ratiolabel.&caliperlabel.) in the &database. from &startdateformatted. to &&enddate&periodid.formatted.&subgrouptitle.),
****************************************************************************************************
* PROGRAM OVERVIEW
****************************************************************************************************
*
* PROGRAM: baseline_output.sas
* Created (mm/dd/yyyy): 03/10/2021
*
*--------------------------------------------------------------------------------------------------
* PURPOSE: This macro drives the creation of Baseline Characteristics Tables proc report output
*
* Program inputs:
* - table1_&periodid.
*
* Program outputs:
*
*
* PARAMETERS:
*
* Programming Notes:
* Utility macro %baseline_procreport created to execute the proc report for each baseline table
*
*
*--------------------------------------------------------------------------------------------------
* CONTACT INFO:
* Sentinel Coordinating Center
* info@sentinelsystem.org
*
***************************************************************************************************;
%macro baseline_output();
%put =====> MACRO CALLED: baseline_output;
%if %eval(&numbaselinetablegrp.>0) %then %do;
/* Set to 2 for effect estimate tables */
%let tablenum = 2;
/*********************************************************************************************/
/* proc report */
/*********************************************************************************************/
%macro baseline_procreport(order = ,
table = ,
weight = ,
title= ,
characteristiclabel =,
labcharacteristics =,
dpnum = ,
numcolumns = ,
grp1_label=,
grp2_label=,
grp3_label=,
computebalance = ,
includenonpregnant = );
/*save data to reportdata folder*/
%isdata(dataset=repdata.table1&tableletter.);
%if %eval(&nobs.<1) %then %do;
%let dataset = table1_&periodid.;
/*if T6 - merge all switchsteps and create new columns*/
%if &reporttype. = T6 %then %do;
proc sql noprint;
create table table1&tableletter. as
select x.label,
x.grouper,
x.sortorder1,
x.sortorder2,
x.sortorder3,
x.sortorder4,
x.metvar,
x.vartype,
x.analysisgrp,
'Unadjusted' as table,
'Unweighted' as weight,
x.exp_mean&dpnum.,
x.exp_mean&dpnum._char,
x.exp_std&dpnum.,
x.exp_std&dpnum._char,
y.exp_mean&dpnum. as comp_mean&dpnum.,
y.exp_mean&dpnum._char as comp_mean&dpnum._char,
y.exp_std&dpnum. as comp_std&dpnum.,
y.exp_std&dpnum._char as comp_std&dpnum._char,
%if %eval(&maxswitch.=2) %then %do;
z.exp_mean&dpnum. as switch2_mean&dpnum.,
z.exp_mean&dpnum._char as switch2_mean&dpnum._char,
z.exp_std&dpnum. as switch2_std&dpnum.,
z.exp_std&dpnum._char as switch2_std&dpnum._char,
%end;
x.order
from table1_&periodid.(where=(order = &order. and table = 'Switchstep_0')) as x