Visual tools for reviewing and monitoring clinical trial data. A SAS macro package to support QC and exploration through graphical representations.
Description :
This macro generates a Gantt chart in Excel format based on user-specified event data.
Given a dataset containing event start and end days, the macro builds a day-wise array
and visually highlights the event duration using colored cells via ODS EXCEL and
SAS RWI (Report Writing Interface)
Main Features :
- Automatically calculates the time range based on event dates
- Distinguishes ongoing events (with missing end date) using separate cell styling
- Displays events per subject along a horizontal timeline
- All input elements (dataset, variable names, output path, etc.) are configurable
Input Parameters :
outpath - Output directory path for the Excel file
outfile - Output file name (e.g., gant.xlsx)
target_dataest - Input dataset (e.g., work.ae)
target_id - Subject identifier variable (e.g., SUBJID)
target_event_name - Event name variable (e.g., AETERM)
target_st - Event start day variable (e.g., AESTDY)
target_en - Event end day variable (e.g., AEENDY)
Assumptions :
- Event start and end values are integers (typically study day numbers)
- Missing end date indicates an ongoing event
Limitations :
- Large time spans or a high number of subjects may lead to excessive memory use,
potentially resulting in runtime errors
Usage Example :
%event_gant_excel(
outpath=F:\Project\output,
outfile=ae_gant.xlsx,
target_dataest=work.ae,
target_id=SUBJID,
target_event_name=AETERM,
target_st=AESTDY,
target_en=AEENDY
);
Description : Generates an UpSet plot to visualize co-occurrence patterns across
multiple items per individual. If no input dataset is provided,
a synthetic test dataset is generated internally.
The macro performs data preprocessing, aggregation, transposition,
and graphical rendering using PROC TEMPLATE and PROC SGRENDER.
Parameters :
data = Input dataset name (if not specified, a test dataset is auto-generated)
personID = Variable name identifying individuals (e.g., ID)
itemnum = Numeric variable representing item code (e.g., itemnum)
itemname = Character variable for item label (e.g., itemname)
width = Width of the output PNG image in pixels (default: 1000)
height = Height of the output PNG image in pixels (default: 650)
Output :
- Intermediate datasets are created in the WORK/temp library.
- Final output is rendered as a PNG-based UpSet plot using ODS Graphics.
Requirements :
- If specifying a dataset via data=, the variables passed in
personID=, itemnum=, and itemname= must exist in that dataset.
Example Usage :
%upset_plot(data=testdata_upset, personID=ID ,itemnum=itemnum, itemname=itemname);
%upset_plot(data=demodata, personID=SUBJID, itemnum=symptom_code, itemname=symptom_label);%upset_plot(data=pokemon, personID=pokemon_name ,itemnum=typen, itemname=type);
0.2.0(31July2025): Upset-Plot Add
0.1.0(28July2025): Initial version
The package is built on top of SAS Packages Framework(SPF) developed by Bartosz Jablonski.
For more information about the framework, see SAS Packages Framework.
You can also find more SAS Packages (SASPacs) in the SAS Packages Archive(SASPAC).
First, create a directory for your packages and assign a packages fileref to it.
filename packages "\path\to\your\packages";Secondly, enable the SAS Packages Framework. (If you don't have SAS Packages Framework installed, follow the instruction in SPF documentation to install SAS Packages Framework.)
%include packages(SPFinit.sas)Install SAS package you want to use with the SPF's %installPackage() macro.
-
For packages located in SAS Packages Archive(SASPAC) run:
%installPackage(packageName)
-
For packages located in PharmaForest run:
%installPackage(packageName, mirror=PharmaForest)
-
For packages located at some network location run:
%installPackage(packageName, sourcePath=https://some/internet/location/for/packages)
(e.g.
%installPackage(ABC, sourcePath=https://github.com/SomeRepo/ABC/raw/main/))
Load SAS package you want to use with the SPF's %loadPackage() macro.
%loadPackage(packageName)