BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
HitmonTran
Pyrite | Level 9

Hi,

 

I need to plot this comparison graph between 2 variables (see screenshot).  Can someone identify the type of plot and a general procedure for this (looks like it's a comparison between 2 variables for 2 studies)?  Thank you.

HitmonTran_0-1664465252678.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

The basic underlying plot appears to be a Scatter plot. Just has multiple Y axis values for the same X axis value.

The grouping of Study1 and Study2 looks like this might be best from SGPANEL with a Panelby variable holding the values in the Study position, and a Scatter with the X variable the "Cue"/"Non-Cue" value and Y variable with the numeric.

 

A basic example of something similar. Addition options available to control some spacing, grid lines and such.

proc format;
value agegroup
11-13='13 or younger'
14-16='14 and older'
;

proc sgpanel data=sashelp.class;
   panelby sex / ;
   scatter x=age y=height;
   format age agegroup.;
   colaxis type=discrete discreteorder=formatted
   ;
  
run;

View solution in original post

1 REPLY 1
ballardw
Super User

The basic underlying plot appears to be a Scatter plot. Just has multiple Y axis values for the same X axis value.

The grouping of Study1 and Study2 looks like this might be best from SGPANEL with a Panelby variable holding the values in the Study position, and a Scatter with the X variable the "Cue"/"Non-Cue" value and Y variable with the numeric.

 

A basic example of something similar. Addition options available to control some spacing, grid lines and such.

proc format;
value agegroup
11-13='13 or younger'
14-16='14 and older'
;

proc sgpanel data=sashelp.class;
   panelby sex / ;
   scatter x=age y=height;
   format age agegroup.;
   colaxis type=discrete discreteorder=formatted
   ;
  
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 609 views
  • 1 like
  • 2 in conversation