BookmarkSubscribeRSS Feed
Melk
Lapis Lazuli | Level 10

I have 2 likert scale variables of which I ran a Spearman Correlation on. I want to produce a plot to show the strong positive association so I did a scatter, but it seemed to not have made much sense. What would be the best plot for this?

5 REPLIES 5
Rick_SAS
SAS Super FREQ

If your goal is to visualize the agreement between the two variables, you might consider the agreement plot. There is an example in a Getting Started example for PROC FREQ.

 

Alternatively, you might consider a mosaic plot, which you can create automatically by using PROC FREQ. Mosaic plots are often used for nominal categories, whereas you have ordinal categories, but it could still be a potentially interesting plot.

ballardw
Super User

@Melk wrote:

I have 2 likert scale variables of which I ran a Spearman Correlation on. I want to produce a plot to show the strong positive association so I did a scatter, but it seemed to not have made much sense. What would be the best plot for this?


It might help to show the code you used.

 

If you used the full data and not a summary to plot the data try using TRANAPARENCY= with a value around .9 start. A large value, near 1, is closer to fully transparent. When multiple symbols are plotted over each other the color builds up so that the darker or more intense color of the markers shows a more frequent answer.

The following doesn't show a specific association but can give you a feel of what the result might look like. Larger symbols will help.

data example;
   do i = 1 to 1000;    
      var1 = rand('table',.05,.15,.2,.3,.4);
      var2 = rand('table',.05,.15,.2,.3,.4);
      output;
   end;
run;

proc sgplot data=example;
   scatter x=var1 y=var2/ transparency=.95 
                          markerattrs=(color=blue size=5mm) 
   ;
run;
      

HEATMAP is another way to show intensity of color for multiple identical responses though might imply continuity to some.

 

Reeza
Super User

Diverging stacked bar chart is the best one IMO. I sometimes also pull out the neutral and put that on a separate chart to show a comparison more clearly. 

 

However, if it's only two scales, you could probably also do a tree map type diagram, with the squares representing the number in each group.

 

https://www.r-bloggers.com/plotting-likert-scales/

Rick_SAS
SAS Super FREQ

Clearly, we need more information. If the OP only wants to overlay two bars, see Sanjay's post on Likert Charts. But IMHO, that doesn't do a good job of showing the statistical agreement between two variables.

Melk
Lapis Lazuli | Level 10
The 2 variables each have 4 levels but are not the same, although both are ordinal. I do want the graph to reflect the statistical agreement (spearman r=0.7)

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 5 replies
  • 1984 views
  • 3 likes
  • 4 in conversation