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?
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.
@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.
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.
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.