Hi all, I found this %CONSORT macro code to creat the flow diagram from this paper. Methods of a Fully Automated CONSORT Diagram Macro... - SAS Support Communities %include 'C:\Users\eryn-wu\Desktop\CONSORT\consort_macro.sas' / nosource;
proc format;
value off1f
1='Ineligible'
2='Insurance Denied';
value off2f
1='Withdrawal'
2='Progression'
3='Adverse Event'
4='Death'
5='Alternate Therapy';
run;
data example;
call streaminit(1);
array u {1500};
do j = 1 to dim(u);*Variables;
u(j)=rand("Uniform");
end;
length id 8. arm $25. gender smoke_stat $10. offtrt 8.
reg rand treated neo rt surg adj comp $50.;
do i = 1 to 1500;*Patients;
id=i;
call missing(reg,rand,treated,neo,surg,rt,adj,comp);
arm=catx(' ','Arm',1+round(rand("Uniform"),1));
sex=ifc(rand("Uniform")>0.50,'Male','Female');
smoke_chance=rand("Uniform");
if smoke_chance>0.66 then smoke_stat='Former';
else if smoke_chance>0.33 then smoke_stat='Current';
else smoke_stat='Never';
reg='Registered';
if u(i)>=0.1 then do;
rand='Randomized';
if u(i)>=0.15 then do;
treated='Started Treatment';
if u(i)>=0.3 then do;
neo='Completed Neoadjuvant~Chemotherapy';
if u(i)>=0.35 and arm='Arm 2' then rt='Completed Neoadjuvant RT';
if (arm='Arm 1' or ^missing(rt)) and u(i)>=0.4 then do;
surg='Completed Surgery';
if u(i)>=0.5 then do;
adj='Started Adjuvant Therapy';
if u(i)>=0.6 then do;
comp='Completed All Therapy';
end;
end;
end;
end;
if missing(comp) then offtrt2=floor(rand("Uniform")*5+1);
end;
else offtrt2=floor(rand("Uniform")*3+1);
end;
else offtrt=floor(rand("Uniform")*2+1);
output;
end;
drop u: i j;
format offtrt off1f. offtrt2 off2f.;
label arm='Treatment Arm' offtrt='Screen Failure' offtrt2='Off-Treatment' sex='Sex' smoke_stat='Smoking Status';
run;
%CONSORT(data=example2,id=id,
node=reg rand treated neo,
split=|arm,
offreason=offtrt|offtrt2,
offreason_label=Screen Failure|Off-Treatment); but when I used the code, the result was not show same with paper. Mine figure showed the lable of total but the paper did't showed. Beside that, the offtrt2 label also can't show properly. I had try by using SAS 9.4 and also Studio. Does anyone else know any tips or tricks to get it to work?
... View more