Making stacked bar plots for matrix survey items in SPSS

EDIT: This is a re-posted entry from my previous blog.

A couple of people have asked me at this point about making the horizontal, stacked bar plots that I tend to report when it comes to matrix survey items. For example, see below.

This was made in R, but making the same thing in SPSS isn’t so straightforward. I did manage to work it out, though: here are the steps for doing the same thing in SPSS.

  1. Import the data into SPSS.

  2. If it’s not already done this way, recode your ordinal variables into numeric values (e.g., 1, 2, 3).

  3. Label the new values with the original value names (e.g., 1 = “Not important”).

  4. Make sure to label the variables themselves too (e.g., “Grains”, “Vegetables”).

  5. Go to Analyze > Tables > Custom Tables

  6. Select your variables (the different items) and drag them where it says “Columns”.

  7. In the bottom right, where it says “Category Position,” change it to “Column Labels in Rows”.

  8. In the bottom left, click on “Summary Statistics”.

  9. In the top box, remove the default selected option of “Count”.

  10. Add the option “Column Valid N %”, which is under “Column Percent”.

  11. Click “Close” to go back to the main menu.

  12. In the bottom left, click on “Categories and Totals”.

  13. In the section labeled “Show”, uncheck “Empty categories” and “Other values found when data are scanned”.

  14. Click “Apply” and then “OK” to return the table to the output window.

  15. When you see the table in the output window, double click on it to enable selection.

  16. Right-click in the table somewhere, and go to Create Graph > Bar in the pop-up menu.

  17. Double-click on the graph that shows up. A menu should pop up.

  18. Flip over to the “Variables” tab.

  19. In the spot where it says “Row”, you see something that says “X Cluster”. Click on that, and change it to “Stack” and click “Apply.”

  20. Close out that menu, and then click the little button in the upper right of the Graph Editor that has the hover title, “Transpose chart coordinate system”.

  21. Change the labels of the bars by double clicking in the text areas.

  22. Close out of the graph area to have the final graph show up in the output window for copying.

The graph should look like this. A little different, but the same information. (Side note that this exercise was a reminder why I tend not to use SPSS. All of the above, I wrapped up in R into a single line of code.)

Previous
Previous

Statistics, anti-racism, norms, and ideologies

Next
Next

On privilege in protest