-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLabMeanChgFrmBase.sas
117 lines (93 loc) · 3.53 KB
/
LabMeanChgFrmBase.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/****************************************************************************************
Program: Program_3-5.sas
SAS Version: SAS Enterprise Guide 7.15 (SAS 9.4m5)
Developer: Richann Watson
Date: 2020-01-17
Purpose: Produce outputs for SAS� Graphics for Clinical Trials by Example book.
Operating Sys: Windows 10
Macros: NONE
Input: adlchem.sas7bdat, adlbstat.sas7bdat
Output: Output_3-6.rtf
Comments: Use CustomSapphire style that was provided by SAS press
Note CustomSapphire is not provided with SAS but rather created
specifically for SAS Press books
-----------------------------------------------------------------------------------------
****************************************************************************************/
/*******************************************/
/*** BEGIN SECTION TO BE UPDATED BY USER ***/
/*******************************************/
options validvarname=upcase;
%include "/home/smccawille1/sasuser.v94/Program/Styles/CustomSapphire.sas";
libname adam "/home/smccawille1/sasuser.v94/ADAM";
%let outpath =/home/smccawille1/sasuser.v94/Output;
%let outname = Output_3-6;
/* you can download any custom font at dafont.com to test this out or you can remove the portion for custom fonts */
%let font = primetime;
/*****************************************/
/*** END SECTION TO BE UPDATED BY USER ***/
/*****************************************/
title;
/* formats to display time point */
proc format;
value trt
0 = 'Placebo'
54 = 'Xanomeline Low Dose'
81 = 'Xanomeline High Dose'
;
run;
/* get a list of all unique visits */
proc sort data = adam.adlbchem
out = visit (keep = avisit:) nodupkey;
by avisitn avisit;
where avisitn ne 99;
run;
data visfmt;
set visit (rename = (avisitn = start avisit = label));
label = strip(label);
fmtname = 'vis';
run;
/* store the data set in the format library so visit format can be used in PROC SGRENDER */
proc format cntlin = visfmt;
run;
/* create a macro variable that contains a list of all the visits numbers for the tick marks */
data vislist;
set visit end = last;
length vis $100;
retain vis;
vis = catx(' ', vis, avisitn);
if last;
call symputx('vlist', vis);
run;
ods rtf file = "&outpath.\Display_3-3.rtf"
image_dpi = 300
style = customSapphire;
proc print data = adam.adlbstat (obs = 10 drop = paramcd trtan avisitn);
run;
ods rtf close;
/* specify custom font */
proc fontreg mode = all msglevel=verbose;
fontpath "C:\Users\gonza\Desktop\DataRich Consulting\Company Branding\Fonts\&font";
run;
options nobyline nodate nonumber;
ods graphics on / imagefmt = png width = 5in noborder;
ods rtf file = "&outpath.\&outname..rtf"
image_dpi = 300
style = customSapphire;
title j = c 'Laboratory Test: ' font = "&font" bold height = 11pt '#byval2';
proc sgplot data = adam.adlbstat;
by paramcd param;
format trtan trt. avisitn vis.;
series x = avisitn y = chg_mean / markers
group = trta;
scatter x = avisitn y = chg_mean / group = trtan
yerrorlower = lerr
yerrorupper = uerr;
xaxis type = linear label = "Analysis Visit"
min = 2 max = 26
values = (&vlist)
fitpolicy = rotate
valuesrotate = diagonal2;
yaxis type = linear label = "Change from Baseline" ;
run;
ods rtf close;
ods graphics off;