SPSS Statistics

SPSS Statistics

Your hub for statistical analysis, data management, and data documentation. Connect, learn, and share with your peers! 

 View Only
  • 1.  How to create a stacked bar chart for multiple dependent variables

    Posted Sat December 12, 2020 06:15 PM

    I am a (relative) SPSS rookie and currently writing my bachelors thesis in neuropsychology. For this, I am reviewing the results of multiple studies and am looking at the effects of lesions in certain brain areas (independent variables) on the ability to complete various tasks (dependent variables). My independent variables are nominal/dichotomous and my dependent variables are ordinal. I have figured out how to create a table that shows me the percentage of answers belonging to each category on every dependent variable divided by the independent variable (meaning what percentage of studies found an impairment in a e.g. working memory task if the parietal cortex was lesioned vs. if it wasn't). I would now like to convert this table into a stacked bar chart to compare among the dependent variables. Sadly, SPSS does not seem to recognize, that they all share the same categories of answers and therefore doesn't create a stacked bar chart but just a bar chart with multiple bars, giving every answer category in every dependent variable a different color. This does not make for a very neatly organized bar chart, as I would like it. Does anyone know how to solve this problem? I have tried to use the classic route via the diagram editor, but this didn't allow me to include multiple dependent variables in a single chart.

    Any help would be greatly appreciated! Thanks






    #SPSSStatistics
    #Support
    #SupportMigration


  • 2.  RE: How to create a stacked bar chart for multiple dependent variables

    Posted Sat December 12, 2020 09:37 PM

    If the table is laid out in a convenient form, you can convert it to a bar chart by double clicking it into the pivot table editor. Then select the part you want to chart and use Edit > Create chart. However, this will create a clustered bar chart. You can change that in the Chart Editor - again double click the chart and fiddle with it.

    But you can do this directly. Do Graphs > Chart Builder. Select stacked bar chart and drag your category variable to the x axis. Then - here's the trick. Select all the variables you want to stack using ctrl-click and drag to the y axis.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 3.  RE: How to create a stacked bar chart for multiple dependent variables

    Posted Sat December 12, 2020 09:47 PM

    Hi Jon,

    thanks for your reply! I had created the clustered bar chart before, when trying to edit it into a stacked bar chart it just creates a chart with a different colour for every answer-category on every item. Sadly the second suggestion did not work out for my. I selected the variables, used ctrl-click but it would still only create a chart with a single variable.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 4.  RE: How to create a stacked bar chart for multiple dependent variables

    Posted Sat December 12, 2020 09:52 PM

    Did you have the measurement levels set correctly? If you want to send me the data for the variables in question, I can give you more specific advice (jkpeckSupport Member)






    #SPSSStatistics
    #Support
    #SupportMigration


  • 5.  RE: How to create a stacked bar chart for multiple dependent variables

    Posted Sat December 12, 2020 09:57 PM

    I had them set to nominal and ordinal, according to the data. In the chart editor it changed them to metric and I haven't figured out how to change that. I'll happily send you the data, although it might be a bit confusing to you (as i'm using the german version of SPSS and don't exactly know what I'm doing half the time ;) ). I really appreciate it, thanks!






    #SPSSStatistics
    #Support
    #SupportMigration


  • 6.  RE: How to create a stacked bar chart for multiple dependent variables

    Posted Sat December 12, 2020 10:05 PM

    You can set the ML permanently in the Data Editor Variable View or using the VARIABLE LEVEL syntax command.


    I'll look at the data -a sav file, I presume. Just make sure it is clear what you want to chart.






    #SPSSStatistics
    #Support
    #SupportMigration


  • 7.  RE: How to create a stacked bar chart for multiple dependent variables

    Posted Sat December 12, 2020 10:21 PM