Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
/****************************************************************************
* Program/Macro:
Time Course of Test Values, Individual Subject
* Lang/Vers:
SAS V9.2
* Author:
Robert Gordon
* Date:
11/30/2011
* Description:
* This data was created to mimic an image found in a 2008 article,
* http://www.fda.gov/downloads/Drugs/ScienceResearch/ResearchAreas/ucm076777.pdf
* discussing FDA specific tool to detect potentially serious liver injury. It * tracks the course of liver tests over time for an individual subject.
* Using the CTSPedia CDISC lab dataset ADLBC, chose one individual subject and the * appropriate lab tests (Alk Phos, ALT, AST and Bilirubin).
* Plotted upper
* limit of normal values over time.
* Edit Log: 30Nov11 first version complete
28Mar11 team comments incorporated
****************************************************************************/
/* Import the lab dataset from saved location */
PROC IMPORT OUT= WORK.adlbc
DATAFILE= "Location of datafile"
DBMS=CSV REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
/* Subject by specific subject and labtests. Add xULN variable which is the lab test result divided by the lab upper limit of normal */
data graph;
set adlbc;
if usubjid = '01-705-1186';
if lbtestcd in ('ALP','ALT','AST','BILI');
xuln=lbstresn/lbstnrhi;
run;
/* Sort by appropriate variables so that graph will track properly along x-axis */
proc sort data=graph;
by usubjid lbtest anldy;
run;
/*******************************************************************************/
/****CREATE GRAPH TO MIMIC GRAPH FROM ARTICLE USING WIKI ADLBC DATA**************/
/*******************************************************************************/
/* Create annotate dataset that will provide various annotations on the graph. Some of these may be able to be programmed into SAS macro */
data anno1;
length function color $8;
retain xsys ysys '2' hsys '3';
function='label'; color='black'; size=2; x=12; y=.13; text='On Study Drug';output;
function='label'; color='black'; size=2; x=32; y=55; text='Outcome';output;
function='label'; color='black'; size=1.75; x=-4; y=2.3; text='2xULN';output;
function='label'; color='black'; size=1.75; x=-4; y=3.4; text='3xULN';output;
function='move'; x=0; y=0.1; output;
function='draw'; color='black'; line=1; size=.25; x=0; y=.125;output;
function='move'; x=25; y=0.1; output;
function='draw'; color='black'; line=1; size=.25; x=25; y=.125;output;
function='move'; x=0; y=0.1125; output;
function='draw'; color='black'; line=1; size=.25; x=25; y=0.1125;output;
function='move'; x=0; y=0.1125; output;
function='draw'; x=0.5; y=0.125;output;
function='move'; x=0; y=0.1125; output;
function='draw'; x=0.5; y=0.1;output;
function='move'; x=25; y=0.1125; output;
function='draw'; x=24.5; y=0.125;output;
function='move'; x=25; y=0.1125; output;
function='draw'; x=24.5; y=0.1;output;
function='move'; x=32; y=0.1; output;
function='draw'; x=32; y=50;output;
xsys='3';ysys='3';
function='label'; color='black'; length=50; size=2.5; x=10; y=98;
style='Arial/bo'; text='Treatment:';output;
function='label'; color='black'; length=50; size=2.5; x=15; y=95;
style='Arial'; text='Active drug';output;
run;
/* Create graph and output to specific location */
options orientation=landscape nobyline nodate;
goptions reset=all;
ods listing close;
ods rtf file='Output Location and Title.rtf' style=rtf;
goptions reset=all device=PNG target=PNG
xmax = 9 in xpixels=1800
ymax = 7 in ypixels=1400
ftext = 'Arial' ftitle='Arial/bo' htext=2 htitle=4.75;
legend1 label=none position=(top left inside) shape=symbol(30,3)
mode=protect across=1 frame value=(h=2.5 f='arial') offset=(40,-10);
symbol1 color=blue interpol=join value=dot height=4 line=1 width=1.95;
symbol2 color=red interpol=join value=circle height=4 line=2 width=2;
symbol3 color=green interpol=join value=triangle height=4 line=1 width=1.95;
symbol4 color=black interpol=join value=triangle height=4 line=2 width=2;
symbol5 color=blue interpol=join value=dot height=4 line=1 width=1.95;
symbol6 color=red interpol=join value=circle height=4 line=2 width=2;
symbol7 color=green interpol=join value=triangle height=4 line=1 width=1.95;
symbol8 color=black interpol=join value=triangle height=4 line=2 width=2;
axis1 value=(f=arial h=3) label=(f='arial/bo' h=3.5 a=90 "Test Values: xULN") major=(h=2) minor=(h=1.25)logbase=10 order=(.1 1 10 100);
axis2 order=(-5 to 35 by 5) label=(f='arial/bo' h=3.5 "Study Day")value=(f=arial h=3)minor=none;
proc gplot data=graph;
plot xuln*anldy=lbtest/legend=legend1 vaxis=axis1 haxis=axis2 vref=1 2 3 10 lvref=(1 2 2 1) annotate=anno1;
title1 'Time Course of Liver Test Values';
title2 h=3'Subject 01-705-1186,Female,Caucasian,84yrs old';
run;
quit;
ods rtf close;
ods listing;