SAS datalattice_2
/*--Fig_5_5_2 LFT Lattice--*/ data GTL_GS_LFT_Lattice (keep=drug alat biltot alkph asat palat pbiltot palkph pasat visitnum); label alat="ALAT (/ULN)"; label biltot="BILTOT (/ULN)"; label alkph="ALKPH (/ULN)"; label asat="ASAT (/ULN)"; visitnum=1; do i= 1 to 100; palat = min (4, 2.5 * (abs(rannor(123))) / 3.0); pbiltot = min (4, 2.5 * (abs(rannor(123))) / 3.0); palkph = min (4, 2.5 * (abs(rannor(123))) / 3.0); pasat = min (4, 2.5 * (abs(rannor(123))) / 3.0); alat = min (4, 2.5 * (abs(rannor(345))) / 3.0); biltot = min (4, 2.5 * (abs(rannor(345))) / 3.0); alkph = min (4, 2.5 * (abs(rannor(345))) / 3.0); asat = min (4, 2.5 * (abs(rannor(345))) / 3.0); j = rannor(345); if j > 0 then drug = "A"; else drug="B"; output; end; visitnum=2; do i= 1 to 100; palat = min (4, 2.5 * (abs(rannor(789))) / 3.0); pbiltot = min (4, 2.5 * (abs(rannor(789))) / 3.0); palkph = min (4, 2.5 * (abs(rannor(789))) / 3.0); pasat = min (4, 2.5 * (abs(rannor(789))) / 3.0); alat = min (4, 2.5 * (abs(rannor(567))) / 3.5); biltot = min (4, 2.5 * (abs(rannor(567))) / 3.5); alkph = min (4, 2.5 * (abs(rannor(567))) / 3.5); asat = min (4, 2.5 * (abs(rannor(567))) / 3.5); j = rannor(567); if j > 0 then drug = "A"; else drug="B"; output; end; visitnum=3; do i= 1 to 100; palat = min (4, 2.5 * (abs(rannor(321))) / 3.0); pbiltot = min (4, 2.5 * (abs(rannor(321))) / 3.0); palkph = min (4, 2.5 * (abs(rannor(321))) / 3.0); pasat = min (4, 2.5 * (abs(rannor(321))) / 3.0); alat = min (4, 2.5 * (abs(rannor(975))) / 2.5); biltot = min (4, 2.5 * (abs(rannor(975))) / 2.5); alkph = min (4, 2.5 * (abs(rannor(975))) / 2.5); asat = min (4, 2.5 * (abs(rannor(975))) / 2.5); j = rannor(975); if j > 0 then drug = "A"; else drug="B"; output; end; run; proc format; value wk 1='1 Week' 2='3 Months' 3='6 Months'; value lab 1='ALAT' 2='Bilirubin Total' 3='Alk Phosphatase' 4='ASAT'; value $trt "A"="Drug A (n=240)" "B"="Drug B (n=195)"; run; data GTL_GS_LFT_Lattice2 (keep=visitnum drug labtest result pre); format visitnum wk. labtest lab. drug $trt.; label pre='Baseline (/ULN) *' result='Study (/ULN)'; set GTL_GS_LFT_Lattice; pre=palat; labtest=1; result=alat; output; pre=pbiltot; labtest=2; result=biltot; output; pre=palkph; labtest=3; result=alkph; output; pre=pasat; labtest=4; result=asat; output; run; ods html; proc template; define statgraph _datalattice; begingraph; layout datalattice rowvar = visitnum columnvar = labtest / headerlabeldisplay = value rowaxisopts = ( griddisplay = on linearopts = (viewmin = 0 viewmax = 4)) columnaxisopts = (linearopts = (viewmin = 0 viewmax = 4)); layout prototype; scatterplot x = pre y = result / group = drug; referenceline x = 1 / lineattrs = (pattern = dash); referenceline x = 1.5 / lineattrs = (pattern = dash); referenceline x = 2 / lineattrs = (pattern = dash); referenceline y = 1 / lineattrs = (pattern = dash); referenceline y = 1.5 / lineattrs = (pattern = dash); referenceline y = 2 / lineattrs = (pattern = dash); endlayout; endlayout; endgraph; end; run; proc sgrender data = GTL_GS_LFT_Lattice2 template = _datalattice; run;
本文来自博客园,作者:Iving,转载请注明原文链接:https://www.cnblogs.com/SAS-T/p/15371587.html