I have read SAS threads on exporting multiple graphs which use the same predictor and response variables, but I need to export multiple graphs into a single JPG file (or EPS or TIF) when a different predictor variable is used each time. In addition, there is a group variable for some but not all graphs. Here is the code to output to a Word file (not allowed by journal to which I am submitting): /*muscle-liver figure without interaction*/ proc glm data=som.pittonly ; class EEFEMALE (ref="1: Yes") prediabetes; options fmtsearch=(SOM.formats); model log_MRMLIVFAT = CRPERCSC D1AGE EEFEMALE ACTMMVPAM prediabetes/ solution clparm tolerance; where ACTMMVPAM >1 and CRPERCSC>0.00001; estimate 'CRPERCSC' CRPERCSC 0.0680996; store contcont; output out=outpred p=p lclm=lower uclm=upper; run; quit; DATA INPLOTDATA; ACTMMVPAM=179.4505; d1age=75; EEFEMALE=0; prediabetes=0; do CRPERCSC = .10 to .50 by .1; OUTPUT; END; RUN; PROC PLM RESTORE=CONTCONT; SCORE DATA=INPLOTDATA OUT=PLOTDATAnoint PRED=FIT UCLM=U LCLM=L ; RUN; proc sort data = PLOTDATAnoint; by CRPERCSC ; run; /*muscle-liver with WC interaction*/ proc glm data=som.pittonly ; class EEFEMALE (ref="1: Yes") high_WC prediabetes; options fmtsearch=(SOM.formats); model log_MRMLIVFAT = CRPERCSC|high_WC D1AGE EEFEMALE ACTMMVPAM prediabetes/ solution clparm tolerance; where high_wc ne . and ACTMMVPAM >1 and CRPERCSC>0.00001; store contcont; output out=outpred p=p lclm=lower uclm=upper; run; quit; DATA INPLOTDATA; ACTMMVPAM=179.4505; d1age=75; EEFEMALE=0; prediabetes=0; do CRPERCSC = 0.1 to 0.5 by 0.1; DO high_WC=0, 1; OUTPUT; END; end; RUN; PROC PLM RESTORE=CONTCONT; SCORE DATA=INPLOTDATA OUT=PLOTDATA PRED=FIT UCLM=U LCLM=L ; RUN; proc sort data = PLOTDATA; by CRPERCSC high_WC; run; proc format; value high_wc 0='Normal' 1='High'; run; /*MFI adjusted figure NO INTERACTION*/ proc glm data= som.pittonly; class EEFEMALE (ref="1: Yes") prediabetes; options fmtsearch=(SOM.formats); model log_MRMLIVFAT = MRMATHMFI D1AGE EEFEMALE ACTMMVPAM prediabetes/ solution clparm tolerance; store contcont; run; DATA INPLOTDATA; ACTMMVPAM=179.4505; d1age=75; EEFEMALE=0; prediabetes=0; do MRMATHMFI = 0.0 to 0.16 by 0.02; OUTPUT; END; RUN; PROC PLM RESTORE=CONTCONT; SCORE DATA=INPLOTDATA OUT=PLOTDATA_MFI PRED=FIT UCLM=U LCLM=L ; RUN; proc sort data = PLOTDATA_MFI; by MRMATHMFI ; run; ODS _ALL_ CLOSE; ods graphics on /noborder /*width= 410 px height=300 px*/ width=4in height=3in imagefmt=tiff; options nocenter nonumber nodate orientation=landscape; ods word columns=2 file = "C:\Users\Figure 1.docx" STARTPAGE=no; /*MUSCLE-LIVER NO INTERACTION*/ proc sgplot data=PLOTDATAnoint noborder noautolegend ; format CRPERCSC percent9.4; band x=CRPERCSC lower=l upper=u / transparency=0.3 ; series x=CRPERCSC y=fit / markers markerattrs=(symbol="circlefilled" size=5) lineattrs=(pattern=1 color=black); /*lineattrs=(thickness=2)*/ series x=CRPERCSC y=u / lineattrs=(pattern=1 color=black); series x=CRPERCSC y=l / lineattrs=(pattern=1 color=black); xaxis label = "Muscle Mass (%)" values = (.10 to .50 by .10) LABELATTRS=(size=12pt family="Arial") valueattrs=(size=12pt family="Arial"); yaxis label = "Log Liver Fat (%)" values = (-5.0 to 0 by 0.50) LABELATTRS=(size=12pt family="Arial") valueattrs=(size=12pt family="Arial"); INSET "P=0.82" "Per-SD Adjusted Beta 95%CI:" "-0.87 (-8.1, 6.9)" / TEXTATTRS = (SIZE=12 family="Arial"); run; /*MFI-LIVER NO INTERACTION*/ proc sgplot data=PLOTDATA_MFI noborder noautolegend ; format MRMATHMFI percent9.4; band x=MRMATHMFI lower=l upper=u / transparency=0.3 ; series x=MRMATHMFI y=fit / markers markerattrs=(symbol="circlefilled" size=5) lineattrs=(pattern=1 color=black); /*lineattrs=(thickness=2)*/ series x=MRMATHMFI y=u / lineattrs=(pattern=1 color=black); series x=MRMATHMFI y=l / lineattrs=(pattern=1 color=black); xaxis label = "Mean Anterior Thigh Muscle Fat Infiltration (%)" values = (0.0 to 0.16 by 0.02) LABELATTRS=(size=12pt family="Arial") valueattrs=(size=11pt family="Arial"); yaxis label = "Log Liver Fat (%)" values = (-5.0 to 0 by 0.50) LABELATTRS=(size=12pt family="Arial") valueattrs=(size=12pt family="Arial"); INSET "P=0.0003" "Per-SD Adjusted Beta 95%CI:" "15.2 (6.8, 24.3)" / TEXTATTRS = (SIZE=12 family="Arial"); run; proc sort data = outpred; by high_WC CRPERCSC ; run; /*MUSCLE-LIVER WITH INTERACTION*/ proc sgplot data=PLOTDATA noborder ; format high_WC high_WC. CRPERCSC percent9.4; label high_WC = "Waist circumference"; band x=CRPERCSC lower=l upper=u / group=high_WC transparency=0.3; styleattrs datacolors=(blue orange ); series x=CRPERCSC y=fit / group=high_WC markers markerattrs=(symbol="circlefilled" size=5 ) lineattrs=(pattern=1 color=black); /*lineattrs=(thickness=2)*/ series x=CRPERCSC y=u / group=high_WC lineattrs=(pattern=1 color=black); series x=CRPERCSC y=l / group=high_WC lineattrs=(pattern=1 color=black); xaxis label = "Muscle Mass (%)" values = (.1 to .5 by .1) LABELATTRS=(size=12pt family="Arial") valueattrs=(size=12pt family="Arial"); yaxis label = "Log Liver Fat (%)" values = (-5.0 to 0 by 0.50) LABELATTRS=(size=12pt family="Arial") valueattrs=(size=12pt family="Arial"); INSET ("(*ESC*){UNICODE P}" = "Interaction P=0.001" ) / TEXTATTRS = (SIZE=12 family="Arial"); run; ods word close;
... View more