****************************************************************************************************
* PROGRAM OVERVIEW
****************************************************************************************************
*
* PROGRAM: l2_psdistribution_output.sas
* Created (mm/dd/yyyy): 03/17/2021
*
*--------------------------------------------------------------------------------------------------
* PURPOSE: The macro creates both aggregated and DP specific PS histograms
*
* Program inputs:
*
* Program outputs:
*
* PARAMETERS:
*
* Programming Notes:
*
*
*--------------------------------------------------------------------------------------------------
* CONTACT INFO:
* Sentinel Coordinating Center
* info@sentinelsystem.org
*
***************************************************************************************************;
%macro l2_psdistribution_output;
%macro output_histogram(type=, weight=);
%isdata(dataset=repdata.Figure&figurenum.&tableletter.);
%if %eval(&nobs=0) %then %do;
data repdata.Figure&figurenum.&tableletter.;
set histogram_&i. (where=(runid="&runid." and order="&loopcount." and subgroup="&subgroup." and subgroupcat="&subgroupcat."));
run;
%end;
proc sgplot data=histogram_&i. (where=(runid="&runid." and order="&loopcount." and subgroup="&subgroup." and subgroupcat="&subgroupcat."));
histogram bin_eoi / freq = _eoi transparency=0.8 fillattrs=(color=blue) binstart = 0 binwidth = 0.025;
histogram bin_ref / freq =_ref transparency=0.8 fillattrs=(color=red) binstart = 0 binwidth = 0.025;
keylegend / location=outside position=bottom noborder valueattrs=(size=&fontsize. family=&font.);
xaxis label = "PS" labelattrs=(size=&fontsize. family=&font. color=gray) valueattrs=(size=&fontsize. family=&font. color=gray) values=(0 to 1 by .2) offsetmax = .02;
yaxis display=(noline) label="Percent" labelattrs=(size=&fontsize. family=&font. color=gray) valueattrs=(size=&fontsize. family=&font. color=gray);
where type = "&type." and weight="&weight." and dp = "&maskeddpid." and lowcase(analysisgrp) = "&analysisgrp.";
run;
%mend output_histogram;
options orientation=portrait;
options nocenter;
ods startpage = now;
ods startpage = no;
%let tablecount=1;
%let tableletter=a;
%do i = %eval(&look_start) %to %eval(&look_end); /*loop through periods*/
%do loopcount = 1 %to &numl2comparisons.;
data _NULL_;
set l2comparisonfile(where=(order=&loopcount.));
call symputx('runid', runid);
call symputx('analysisgrp', analysisgrp);
call symputx('OutputPSDistribution', OutputPSDistribution);
run;
%isdata(dataset=labelfile);
%let grouplabel=&analysisgrp.;
%if %eval(&nobs>0) %then %do;
data _NULL_;
set labelfile(where=(lowcase(labeltype)='grouplabel'));
if group="&analysisgrp." and runid="&runid.";
call symputx("grouplabel", %quote(Label));
run;
%end;
%if &OutputPSDistribution. = Y %then %do;
proc sql noprint;
select strip(file) into: psfile
from pscs_masterinputs
where analysisgrp = "&analysisgrp." and runid = "&runid";
quit;
%let ratiohist =;
%let caliperhist =;
%let andafter =;
%let matchtype = ;
%let analysisgrphist = ;
%let analysisgrpchemelong = ;
%let pstrim =;