BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kcodo
Obsidian | Level 7

So I have these 4 graphs that I want to fit into one panel.

 

I created these graphs with the codes below:

proc format; 
value group 0="control" 1="OA" 2= "LSS";
run;
title2 "Double Support vs.Physical Function with loess fit";
proc sgplot data=mydata;
loess x=PF  y=DS_median /alpha=0.05 interpolation=linear degree=1
 group=group;
scatter x=PF  y=DS_median / group=group
   markerattrs=(symbol=CircleFilled size=14)
   filledoutlinedmarkers 
   colormodel=(CX3288BD CX99D594 CXE6F598 CXFEE08B CXFC8D59 CXD53E4F);
xaxis grid; yaxis grid; 
xaxis label='Physical Function Score';
yaxis label='Percent Double Support';
format group group.;
run; quit;
proc format; 
value group 0="control" 1="OA" 2= "LSS";
run;
title2 "#cycles_total vs. physical function with loess fit";
proc sgplot data=mydata;
loess x=PF  y=NrCycles /interpolation=linear degree=1
 group=group;
scatter x=PF  y=NrCycles / group=group
   markerattrs=(symbol=CircleFilled size=14)
   filledoutlinedmarkers 
   colormodel=(CX3288BD CX99D594 CXE6F598 CXFEE08B CXFC8D59 CXD53E4F);
xaxis grid; yaxis grid; 
xaxis label='Physical Function Score';
yaxis label='Number of Total Gait Cycles';
format group group.;
run; quit;
title2 "Straight Cycles vs. physical function with loess fit";
proc sgplot data=mydata;
loess x=PF  y=NrCycleStraight /interpolation=linear degree=1
 group=group;
scatter x=PF  y=NrCycleStraight / group=group
   markerattrs=(symbol=CircleFilled size=14)
   filledoutlinedmarkers 
   colormodel=(CX3288BD CX99D594 CXE6F598 CXFEE08B CXFC8D59 CXD53E4F);
xaxis grid; yaxis grid; 
xaxis label='Physical Function Score';
yaxis label='Number of Straight Gait Cycles';
format group group.;
run; quit;
title2 "Curved Cycles vs. physical function with loess fit";
proc sgplot data=mydata;
loess x=PF  y=NrCycleTurn /interpolation=linear degree=1
 group=group;
scatter x=PF  y=NrCycleTurn / group=group
   markerattrs=(symbol=CircleFilled size=14)
   filledoutlinedmarkers 
   colormodel=(CX3288BD CX99D594 CXE6F598 CXFEE08B CXFC8D59 CXD53E4F);
xaxis grid; yaxis grid; 
xaxis label='Physical Function Score';
yaxis label='Number of Curved Gait Cycles';
format group group.;
run; quit;

Attached is the graphs that the above code produces. I would like all 4 graphs in one view/panel/page as opposed to how they are now on separate pages.

I had considered doing a proc sgpanel data=mydata;

but not sure how to proceed to combine the 4 separate codes as above. Any help much appreciated.

thanks! 

1 ACCEPTED SOLUTION
2 REPLIES 2
kcodo
Obsidian | Level 7
this comes close to what I'm trying to do. However, the loess curves disappear when I use what they suggested. I guess I'll take it for now. Thank you.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 953 views
  • 1 like
  • 2 in conversation