/************************************************************************* * This macro is used to replicate all analyses results from the paper * * Network meta-regression for ordinal outcomes: * * Applications to in comparing Crohn's disease treatments * * By Gwon et al.(2020) Statistics in Medicine; 39: pp. 1846-1870 * * * * Written by Drs.Yeongjin Gwon and Ming-Hui Chen, February, 2021 * *************************************************************************/ %macro NMAOrdinal(CDdata,Model,Amatrix); /* Checking error message for input values */ %if (&Model>3) %then %do; %put ERROR: Invalid Model number; %return; %end; %if (&Amatrix>3) %then %do; %put ERROR: Invalid constant matrix A; %return; %end; %if (&CDdata=Crohn1) %then %do; %put Message: You are running Scenario1; %end; %else %if (&CDdata=Crohn2) %then %do; %put Message: You are running Scenario2; %end; %else %if (&CDdata=Crohn3) %then %do; %put Message: You are running Scenario3; %end; %else %do; %put ERROR: Invalid Dataset; %return; %end; /* Score test to examine Proportional Odds assumption */ proc logistic data=&CDdata; where Trt>0; freq count; class K Trt / param=ref ref=first; model Response=Trt / link=clogit expb aggregate scale=none; by K; run; /* Section 2: Cleansing data and standardization */ data Crohn_Placebo; set &CDdata; if Trt=0 then do; n1=0;n2=0;n3=0;n4=0; if Response=1 then n1=count; else if Response=2 then n2=count; else if Response=3 then n3=count; else n4=count; end; else delete; run; data Crohn_Treatment; set &CDdata; if Trt>0 then do; n1=0;n2=0;n3=0;n4=0; if Response=1 then n1=count; else if Response=2 then n2=count; else if Response=3 then n3=count; else n4=count; end; else delete; run; proc sql; create table Crohn_Placebo_aggregate as select mean(K) as K, mean(Trt) as TRT, mean(Age) as AGE, mean(CDAI) as CDAIscore, mean(year) as Year, mean(male) as MALE, mean(antiTNF) as antiTNF, mean(collapsity) as collapsity, sum(n1) as y1, sum(n2) as y2, sum(n3) as y3, sum(n4) as y4 from Crohn_Placebo where K>0 group by K; run; quit; proc sql; create table Crohn_Treatment_aggregate as select mean(K) as K, mean(Trt) as TRT, mean(Age) as AGE, mean(CDAI) as CDAIscore, mean(year) as Year, mean(male) as MALE, mean(antiTNF) as antiTNF, mean(collapsity) as collapsity, sum(n1) as y1, sum(n2) as y2, sum(n3) as y3, sum(n4) as y4 from Crohn_Treatment where K>0 group by K; run; quit; data Crohn_Placebo_aggregate; set Crohn_Placebo_aggregate; Pmale=MALE/(y1+y2+y3+y4); PantiTNF=antiTNF/100; drop MALE antiTNF; run; data Crohn_Treatment_aggregate; set Crohn_Treatment_aggregate; Pmale=MALE/(y1+y2+y3+y4); PantiTNF=antiTNF/100; drop MALE antiTNF; run; data Crohn_aggregate; set Crohn_Placebo_aggregate Crohn_Treatment_aggregate; by K; run; proc means data=Crohn_aggregate; var AGE CDAIscore Year Pmale PantiTNF; output out=mout mean=mage mCDAIscore mYear mPmale mTNF std=sdAGE sdCDAIscore sdYear sdPmale sdTNF; run; proc univariate data=Crohn_aggregate; var AGE CDAIscore Year Pmale PantiTNF; run; proc means data=Crohn_aggregate; var PantiTNF Pmale AGE CDAIscore; by K; output out=testout mean=Kmanti KmPmale Kmage Kmcdai; run; data Crohn_augument; set Crohn_aggregate; if _n_=1 then set mout; run; data test2; merge Crohn_augument testout; by K; run; proc means data=test2; var Kmanti KmPmale Kmage Kmcdai; output out=testout2 mean=Kanti KPmale Kage Kcdai std=Ksdanti KsdPmale Ksdage Ksdcdai; run; data Crohn_augument; set test2; if _n_=1 then set testout2; run; data Crohn_augument; set Crohn_augument; age=(age-mage)/sdage; CDAIscore=(CDAIscore-mCDAIscore)/sdCDAIscore; Pmale=(Pmale-mPmale)/sdPmale; Year=(Year-mYear)/sdYear; PantiTNF=(PantiTNF-mTNF)/sdTNF; KantiTNF=(Kmanti-Kanti)/Ksdanti; KPmale=(KmPmale-KPmale)/KsdPmale; Kage=(Kmage-Kage)/Ksdage; Kcdai=(Kmcdai-Kcdai)/Ksdcdai; run; data Crohn_augument; set Crohn_augument; cCDAIscore=CDAIscore*sdCDAIscore; cPmale=Pmale*sdPmale; cage=age*sdage; cTNF=PantiTNF*sdTNF; run; proc sort data=Crohn_augument; by K; run; proc univariate data=Crohn_augument noprint; var cCDAIscore cPmale cage cTNF; output out=outCDAI mean=mcCDAIscore mcPmale mcage mcTNF; by K; run; data Crohn_augument; merge Crohn_augument outCDAI; by K; run; data Crohn; set Crohn_augument; cs=lfact(y1+y2+y3+y4); c1=lfact(y1); c2=lfact(y2); c3=lfact(y3); c4=lfact(y4); coeffi=cs-(c1+c2+c3+c4); keep k TRT collapsity y1 y2 y3 y4 AGE CDAIscore Year Pmale PantiTNF c1 c2 c3 c4 cs coeffi; run; /* Running Statistical Models */ %if &CDdata='Crohn2' %then %do; %if &Model=1 %then %do; proc nlmixed data=Crohn; parms eta1=0.58 eta2=0.37 eta3=0.7 phi0=-3.5 T1=-0.89 T2=-0.21 T3=-1.9 T4=-0.68 T5=-0.8 T6=-0.66; bounds eta2>0,eta3>0; z1=eta1; z2=z1+eta2; z3=z2+eta3; zbeta=exp(phi0)*mu_k; TRT1=T1*(TRT=1)+T2*(TRT=2)+T3*(TRT=3)+T4*(TRT=4)+T5*(TRT=5)+T6*(TRT=6); if (collapsity eq -1) then do; p1=1/(1+exp(-(z1+TRT1+zbeta))); p2=1/(1+exp(-(z2+TRT1+zbeta)))-1/(1+exp(-(z1+TRT1+zbeta))); p3=1/(1+exp(-(z3+TRT1+zbeta)))-1/(1+exp(-(z2+TRT1+zbeta))); p4=1-1/(1+exp(-(z3+TRT1+zbeta))); loglik=(y1+y2)*log(p1+p2)+y3*log(p3)+y4*log(p4)+coeffi; end; else if (collapsity eq 1) then do; p1=1/(1+exp(-(z1+TRT1+zbeta))); p2=1/(1+exp(-(z2+TRT1+zbeta)))-1/(1+exp(-(z1+TRT1+zbeta))); p3=1/(1+exp(-(z3+TRT1+zbeta)))-1/(1+exp(-(z2+TRT1+zbeta))); p4=1-1/(1+exp(-(z3+TRT1+zbeta))); loglik=y1*log(p1)+(y2+y3)*log(p2+p3)+y4*log(p4)+coeffi; end; else if (collapsity eq 2) then do; p1=1/(1+exp(-(z1+TRT1+zbeta))); p2=1/(1+exp(-(z2+TRT1+zbeta)))-1/(1+exp(-(z1+TRT1+zbeta))); p3=1/(1+exp(-(z3+TRT1+zbeta)))-1/(1+exp(-(z2+TRT1+zbeta))); p4=1-1/(1+exp(-(z3+TRT1+zbeta))); loglik=y1*log(p1)+(y2+y3+y4)*log(p2+p3+p4)+coeffi; end; else do; p1=1/(1+exp(-(z1+TRT1+zbeta))); p2=1/(1+exp(-(z2+TRT1+zbeta)))-1/(1+exp(-(z1+TRT1+zbeta))); p3=1/(1+exp(-(z3+TRT1+zbeta)))-1/(1+exp(-(z2+TRT1+zbeta))); p4=1-1/(1+exp(-(z3+TRT1+zbeta))); loglik=y1*log(p1)+y2*log(p2)+y3*log(p3)+y4*log(p4)+coeffi; end; model y1~general(loglik); random mu_k~normal(0,1) subject=K; ods output ParameterEstimates=_para_est FitStatistics=_fit AdditionalEstimates=_pair_comp; estimate 'Infliximab-Vedolizumab 300mg' T3-T6; estimate 'Infliximab-Ustakinumab 6mg/kg' T3-T5; estimate 'Infliximab-Natalizumab 300mg' T3-T4; estimate 'Infliximab-Adalimumab' T3-T1; estimate 'Infliximab-Certolizumab 400mg' T3-T2; estimate 'Vedolizumab 300mg-Ustakinumab 6mg/kg' T6-T5; estimate 'Vedolizumab 300mg-Natalizumab 300mg' T6-T4; estimate 'Vedolizumab 300mg-Adalimumab' T6-T1; estimate 'Vedolizumab 300mg-Certolizumab 400mg' T6-T2; estimate 'Ustakinumab 6mg/kg-Natalizumab 300mg' T5-T4; estimate 'Ustakinumab 6mg/kg-Adalimumab' T5-T1; estimate 'Ustakinumab 6mg/kg-Certolizumab 400mg' T5-T2; estimate 'Natalizumab 300mg-Adalimumab' T4-T1; estimate 'Natalizumab 300mg-Certolizumab 400mg' T4-T2; estimate 'Adalimumab-Certolizumab 400mg' T1-T2; predict p1 out=p1; /*prob(resp<70)for non-collapsed groups*/ predict p2 out=p2; /*prob(70<=resp<100) for non-collapsed groups */ predict p3 out=p3; /*prob(100<=resp0,eta3>0; zbeta=exp(phi0); xbeta=beta1*AGE+beta2*Pmale+beta3*CDAIscore+beta4*year+beta5*PantiTNF+zbeta*mu_k; z1=eta1; z2=z1+eta2; z3=z2+eta3; TRT1=T1*(TRT=1)+T2*(TRT=2)+T3*(TRT=3)+T4*(TRT=4)+T5*(TRT=5)+T6*(TRT=6); if (collapsity eq -1) then do; p1=1/(1+exp(-(z1+TRT1+xbeta))); p2=1/(1+exp(-(z2+TRT1+xbeta)))-1/(1+exp(-(z1+TRT1+xbeta))); p3=1/(1+exp(-(z3+TRT1+xbeta)))-1/(1+exp(-(z2+TRT1+xbeta))); p4=1-1/(1+exp(-(z3+TRT1+xbeta))); loglik=(y1+y2)*log(p1+p2)+y3*log(p3)+y4*log(p4)+coeffi; end; else if (collapsity eq 1) then do; p1=1/(1+exp(-(z1+TRT1+xbeta))); p2=1/(1+exp(-(z2+TRT1+xbeta)))-1/(1+exp(-(z1+TRT1+xbeta))); p3=1/(1+exp(-(z3+TRT1+xbeta)))-1/(1+exp(-(z2+TRT1+xbeta))); p4=1-1/(1+exp(-(z3+TRT1+xbeta))); loglik=y1*log(p1)+(y2+y3)*log(p2+p3)+y4*log(p4)+coeffi; end; else if (collapsity eq 2) then do; p1=1/(1+exp(-(z1+TRT1+xbeta))); p2=1/(1+exp(-(z2+TRT1+xbeta)))-1/(1+exp(-(z1+TRT1+xbeta))); p3=1/(1+exp(-(z3+TRT1+xbeta)))-1/(1+exp(-(z2+TRT1+xbeta))); p4=1-1/(1+exp(-(z3+TRT1+xbeta))); loglik=y1*log(p1)+(y2+y3+y4)*log(p2+p3+p4)+coeffi; end; else do; p1=1/(1+exp(-(z1+TRT1+xbeta))); p2=1/(1+exp(-(z2+TRT1+xbeta)))-1/(1+exp(-(z1+TRT1+xbeta))); p3=1/(1+exp(-(z3+TRT1+xbeta)))-1/(1+exp(-(z2+TRT1+xbeta))); p4=1-1/(1+exp(-(z3+TRT1+xbeta))); loglik=y1*log(p1)+y2*log(p2)+y3*log(p3)+y4*log(p4)+coeffi; end; model y1~general(loglik); random mu_k~normal(0,1) subject=K; ods output ParameterEstimates=_para_est FitStatistics=_fit AdditionalEstimates=_pair_comp; estimate 'Infliximab-Vedolizumab 300mg' T3-T6; estimate 'Infliximab-Ustakinumab 6mg/kg' T3-T5; estimate 'Infliximab-Natalizumab 300mg' T3-T4; estimate 'Infliximab-Adalimumab' T3-T1; estimate 'Infliximab-Certolizumab 400mg' T3-T2; estimate 'Vedolizumab 300mg-Ustakinumab 6mg/kg' T6-T5; estimate 'Vedolizumab 300mg-Natalizumab 300mg' T6-T4; estimate 'Vedolizumab 300mg-Adalimumab' T6-T1; estimate 'Vedolizumab 300mg-Certolizumab 400mg' T6-T2; estimate 'Ustakinumab 6mg/kg-Natalizumab 300mg' T5-T4; estimate 'Ustakinumab 6mg/kg-Adalimumab' T5-T1; estimate 'Ustakinumab 6mg/kg-Certolizumab 400mg' T5-T2; estimate 'Natalizumab 300mg-Adalimumab' T4-T1; estimate 'Natalizumab 300mg-Certolizumab 400mg' T4-T2; estimate 'Adalimumab-Certolizumab 400mg' T1-T2; predict p1 out=p1; /*prob(resp<70)for non-collapsed groups*/ predict p2 out=p2; /*prob(70<=resp<100) for non-collapsed groups */ predict p3 out=p3; /*prob(100<=resp0,eta3>0; z1=eta1; z2=z1+eta2; z3=z2+eta3; zbeta=exp(phi0)*mu_k; TRT1=T1*(TRT=1)+T2*(TRT=2)+T3*(TRT=3)+T4*(TRT=4)+T5*(TRT=5)+T6*(TRT=6); if (collapsity eq -1) then do; p1=1/(1+exp(-(z1+TRT1+zbeta))); p2=1/(1+exp(-(z2+TRT1+zbeta)))-1/(1+exp(-(z1+TRT1+zbeta))); p3=1/(1+exp(-(z3+TRT1+zbeta)))-1/(1+exp(-(z2+TRT1+zbeta))); p4=1-1/(1+exp(-(z3+TRT1+zbeta))); loglik=(y1+y2)*log(p1+p2)+y3*log(p3)+y4*log(p4)+coeffi; end; else if (collapsity eq 1) then do; p1=1/(1+exp(-(z1+TRT1+zbeta))); p2=1/(1+exp(-(z2+TRT1+zbeta)))-1/(1+exp(-(z1+TRT1+zbeta))); p3=1/(1+exp(-(z3+TRT1+zbeta)))-1/(1+exp(-(z2+TRT1+zbeta))); p4=1-1/(1+exp(-(z3+TRT1+zbeta))); loglik=y1*log(p1)+(y2+y3)*log(p2+p3)+y4*log(p4)+coeffi; end; else if (collapsity eq 2) then do; p1=1/(1+exp(-(z1+TRT1+zbeta))); p2=1/(1+exp(-(z2+TRT1+zbeta)))-1/(1+exp(-(z1+TRT1+zbeta))); p3=1/(1+exp(-(z3+TRT1+zbeta)))-1/(1+exp(-(z2+TRT1+zbeta))); p4=1-1/(1+exp(-(z3+TRT1+zbeta))); loglik=y1*log(p1)+(y2+y3+y4)*log(p2+p3+p4)+coeffi; end; else do; p1=1/(1+exp(-(z1+TRT1+zbeta))); p2=1/(1+exp(-(z2+TRT1+zbeta)))-1/(1+exp(-(z1+TRT1+zbeta))); p3=1/(1+exp(-(z3+TRT1+zbeta)))-1/(1+exp(-(z2+TRT1+zbeta))); p4=1-1/(1+exp(-(z3+TRT1+zbeta))); loglik=y1*log(p1)+y2*log(p2)+y3*log(p3)+y4*log(p4)+coeffi; end; model y1~general(loglik); random mu_k~normal(0,1) subject=K; ods output ParameterEstimates=_para_est FitStatistics=_fit AdditionalEstimates=_pair_comp; estimate 'Infliximab-Vedolizumab 300mg' T3-T6; estimate 'Infliximab-Ustakinumab 6mg/kg' T3-T5; estimate 'Infliximab-Natalizumab 300mg' T3-T4; estimate 'Infliximab-Adalimumab' T3-T1; estimate 'Infliximab-Certolizumab 400mg' T3-T2; estimate 'Vedolizumab 300mg-Ustakinumab 6mg/kg' T6-T5; estimate 'Vedolizumab 300mg-Natalizumab 300mg' T6-T4; estimate 'Vedolizumab 300mg-Adalimumab' T6-T1; estimate 'Vedolizumab 300mg-Certolizumab 400mg' T6-T2; estimate 'Ustakinumab 6mg/kg-Natalizumab 300mg' T5-T4; estimate 'Ustakinumab 6mg/kg-Adalimumab' T5-T1; estimate 'Ustakinumab 6mg/kg-Certolizumab 400mg' T5-T2; estimate 'Natalizumab 300mg-Adalimumab' T4-T1; estimate 'Natalizumab 300mg-Certolizumab 400mg' T4-T2; estimate 'Adalimumab-Certolizumab 400mg' T1-T2; predict p1 out=p1; /*prob(resp<70)for non-collapsed groups*/ predict p2 out=p2; /*prob(70<=resp<100) for non-collapsed groups */ predict p3 out=p3; /*prob(100<=resp0,eta3>0; zbeta=exp(phi0); xbeta=beta1*AGE+beta2*Pmale+beta3*CDAIscore+beta4*year+beta5*PantiTNF+zbeta*mu_k; z1=eta1; z2=z1+eta2; z3=z2+eta3; TRT1=T1*(TRT=1)+T2*(TRT=2)+T3*(TRT=3)+T4*(TRT=4)+T5*(TRT=5)+T6*(TRT=6); if (collapsity eq -1) then do; p1=1/(1+exp(-(z1+TRT1+xbeta))); p2=1/(1+exp(-(z2+TRT1+xbeta)))-1/(1+exp(-(z1+TRT1+xbeta))); p3=1/(1+exp(-(z3+TRT1+xbeta)))-1/(1+exp(-(z2+TRT1+xbeta))); p4=1-1/(1+exp(-(z3+TRT1+xbeta))); loglik=(y1+y2)*log(p1+p2)+y3*log(p3)+y4*log(p4)+coeffi; end; else if (collapsity eq 1) then do; p1=1/(1+exp(-(z1+TRT1+xbeta))); p2=1/(1+exp(-(z2+TRT1+xbeta)))-1/(1+exp(-(z1+TRT1+xbeta))); p3=1/(1+exp(-(z3+TRT1+xbeta)))-1/(1+exp(-(z2+TRT1+xbeta))); p4=1-1/(1+exp(-(z3+TRT1+xbeta))); loglik=y1*log(p1)+(y2+y3)*log(p2+p3)+y4*log(p4)+coeffi; end; else if (collapsity eq 2) then do; p1=1/(1+exp(-(z1+TRT1+xbeta))); p2=1/(1+exp(-(z2+TRT1+xbeta)))-1/(1+exp(-(z1+TRT1+xbeta))); p3=1/(1+exp(-(z3+TRT1+xbeta)))-1/(1+exp(-(z2+TRT1+xbeta))); p4=1-1/(1+exp(-(z3+TRT1+xbeta))); loglik=y1*log(p1)+(y2+y3+y4)*log(p2+p3+p4)+coeffi; end; else do; p1=1/(1+exp(-(z1+TRT1+xbeta))); p2=1/(1+exp(-(z2+TRT1+xbeta)))-1/(1+exp(-(z1+TRT1+xbeta))); p3=1/(1+exp(-(z3+TRT1+xbeta)))-1/(1+exp(-(z2+TRT1+xbeta))); p4=1-1/(1+exp(-(z3+TRT1+xbeta))); loglik=y1*log(p1)+y2*log(p2)+y3*log(p3)+y4*log(p4)+coeffi; end; model y1~general(loglik); random mu_k~normal(0,1) subject=K; ods output ParameterEstimates=_para_est FitStatistics=_fit AdditionalEstimates=_pair_comp; estimate 'Infliximab-Vedolizumab 300mg' T3-T6; estimate 'Infliximab-Ustakinumab 6mg/kg' T3-T5; estimate 'Infliximab-Natalizumab 300mg' T3-T4; estimate 'Infliximab-Adalimumab' T3-T1; estimate 'Infliximab-Certolizumab 400mg' T3-T2; estimate 'Vedolizumab 300mg-Ustakinumab 6mg/kg' T6-T5; estimate 'Vedolizumab 300mg-Natalizumab 300mg' T6-T4; estimate 'Vedolizumab 300mg-Adalimumab' T6-T1; estimate 'Vedolizumab 300mg-Certolizumab 400mg' T6-T2; estimate 'Ustakinumab 6mg/kg-Natalizumab 300mg' T5-T4; estimate 'Ustakinumab 6mg/kg-Adalimumab' T5-T1; estimate 'Ustakinumab 6mg/kg-Certolizumab 400mg' T5-T2; estimate 'Natalizumab 300mg-Adalimumab' T4-T1; estimate 'Natalizumab 300mg-Certolizumab 400mg' T4-T2; estimate 'Adalimumab-Certolizumab 400mg' T1-T2; predict p1 out=p1; /*prob(resp<70)for non-collapsed groups*/ predict p2 out=p2; /*prob(70<=resp<100) for non-collapsed groups */ predict p3 out=p3; /*prob(100<=resp=0) then PscoreMat[i,j]=temp2[i,j]/2; else PscoreMat[i,j]=1-temp2[i,j]/2; end; end; do i=1 to nT; do j=1 to nT; if (i=j) then PscoreMat[i,j]=PscoreMat[i,j]; else PscoreMat[j,i]=1-PscoreMat[i,j]; end; end; RowSum=PscoreMat[,+]; Pscore=round(RowSum/(nT-1),0.001); Pscore=Pscore`; create stat4 from Pscore; append from Pscore; close stat4; quit; data stat4(rename=(COL1=Infliximab COL2=Vedolizumab COL3=Ustekinumab COL4=Natalizumab COL5=Adalimumab COL6=Certolizumab)); set stat4; run; /* Create all relevant outputs to RTF files */ ods rtf file="RESULT.rtf" bodytitle; proc report data=_para_est nowd center split='|' headline headskip style(report)=[font_face='Times New Roman' font_size=10pt] style(column)=[font_face='Times New Roman' font_size=10pt] style(lines) =[font_face='Times New Roman' font_size=10pt just=c font_weight=bold foreground=black background=GRAYB8]; columns Parameter Estimate StandardError Probt Lower Upper; define Parameter / "Parameters" display; define Estimate / "Estimates" display format=comma8.3; define StandardError / "SE" display format=comma8.3; define Probt / "P-value" display format=comma8.3; define Lower / "95% LCI" display format=comma8.3; define Upper / "95% UCI" display format=comma8.3; title 'Parameter Estimates'; run; proc report data=_fit nowd center split='|' headline headskip style(report)=[font_face='Times New Roman' font_size=10pt] style(column)=[font_face='Times New Roman' font_size=10pt] style(lines) =[font_face='Times New Roman' font_size=10pt just=c font_weight=bold foreground=black background=GRAYB8]; columns loglik AIC AICC BIC; define loglik / "-2Loglik" display format=comma8.2; define AIC / "AIC" display format=comma8.2; define AICC / "AICC" display format=comma8.2; define BIC / "BIC" display format=comma8.2; title 'Model Assessment Criteria'; run; proc report data=_pair_comp nowd center split='|' headline headskip style(report)=[font_face='Times New Roman' font_size=10pt] style(column)=[font_face='Times New Roman' font_size=10pt] style(lines) =[font_face='Times New Roman' font_size=10pt just=c font_weight=bold foreground=black background=GRAYB8]; columns Label Estimate StandardError Probt Lower Upper; define Label / "Mean differences" display; define Estimate / "Estimates" display format=comma8.3; define StandardError / "SE" display format=comma8.3; define Probt / "P-value" display format=comma8.3; define Lower / "95% LCI" display format=comma8.3; define Upper / "95% UCI" display format=comma8.3; title 'Pairwise Comparisons'; run; proc report data=OUT nowd center split='|' headline headskip style(report)=[font_face='Times New Roman' font_size=10pt] style(column)=[font_face='Times New Roman' font_size=10pt] style(lines) =[font_face='Times New Roman' font_size=10pt just=c font_weight=bold foreground=black background=GRAYB8]; columns Trial Group X2stat Pvalue COL1 COL2 COL3; define Trial / "Study" display; define Group / "Arm" display; define X2stat / "Chi-square test Statistic" display format=comma8.3; define Pvalue / "P-value" display format=comma8.3; define COL1 / "Resid1" display format=comma8.3; define COL2 / "Resid2" display format=comma8.3; define COL3 / "Resid3" display format=comma8.3; title 'Model Diagnostics'; run; ods graphics / height=3in width=4in attrpriority=none; proc sgplot data=OUT; title 'Pearson Residuals Plot by Trial'; styleattrs datasymbols=(CircleFilled TriangleFilled) datacontrastcolors=(green purple); scatter x=Trial y=COL1 / group=Group markerattrs=(size=8px); scatter x=Trial y=COL2 / group=Group markerattrs=(size=8px); scatter x=Trial y=COL3 / group=Group markerattrs=(size=8px); yaxis values=(-5 to 5 by 1) label="Pearson Residuals"; xaxis values=(1 to 10 by 1) label="Trial"; refline -3 / axis=y lineattrs=(color=blue pattern=Dot); refline 3 / axis=y lineattrs=(color=blue pattern=Dot); run; proc sgplot data=OUT; title 'P-values Plot for the Goodness-of-fit'; styleattrs datasymbols=(CircleFilled TriangleFilled) datacontrastcolors=(green purple); scatter x=Trial y=Pvalue / group=Group markerattrs=(size=8px); yaxis values=(0 to 1 by 0.1) label="P-value"; xaxis values=(1 to 10 by 1) label="Trial"; refline 0.05/ axis=y lineattrs=(color=blue pattern=Dot); run; proc report data=stat4 nowd center split='|' headline headskip style(report)=[font_face='Times New Roman' font_size=10pt] style(column)=[font_face='Times New Roman' font_size=10pt] style(lines) =[font_face='Times New Roman' font_size=10pt just=c font_weight=bold foreground=black background=GRAYB8]; columns Adalimumab Certolizumab Infliximab Natalizumab Ustekinumab Vedolizumab; define Adalimumab / style(column)={cellwidth=1.0in}; define Certolizumab / style(column)={cellwidth=1.0in}; define Infliximab / style(column)={cellwidth=1.0in}; define Natalizumab / style(column)={cellwidth=1.0in}; define Ustekinumab / style(column)={cellwidth=1.0in}; define Vedolizumab / style(column)={cellwidth=1.0in}; title 'P-Score for Treatment Ranking'; run; ods rtf close; %mend NMAOrdinal;