SPSS Statistics

 View Only
  • 1.  "Diverging" Stacked Bar Charts

    Posted Mon March 27, 2023 09:26 AM
      |   view attached

    Hello. Do you know whether SPSS Statistics allows to create "Diverging" Stacked Bar Charts of multiple variables (for Likert scale data)? Please find attached my chart. As you can see, variables (factors) on the left are not sorted in ascending or descending order. I would much appreciate if anyone helps how to do it. Thank you in advance.



    ------------------------------
    Hanna Shmagun
    ------------------------------


  • 2.  RE: "Diverging" Stacked Bar Charts

    Posted Mon March 27, 2023 10:46 PM

    Hi. I think it's possible to create a stacked bar chart, then edit it in the chart editor and transpose it.  In the chart editor, try Options > Scale to 100%.  Then Options > Transpose Chart.



    ------------------------------
    Rick Marcantonio
    Quality Assurance
    IBM
    ------------------------------



  • 3.  RE: "Diverging" Stacked Bar Charts

    Posted Tue October 17, 2023 05:36 AM
    Edited by Jos Blykers Fri October 20, 2023 08:02 AM

    This is exactly what I am trying to create as chart,Hanna Mag, and then rank in descending order based on one of the values. Any tips / syntax to share?

    I managed to create the stacked chart (I chose stacked histogram), but then the question remains how to rank (descending or ascending) based on one of the values (for example: percentage 'strongly agree').  Maybe there is a GGRAPH or GPL command?

    Below, my syntax

    DATASET ACTIVATE FAVUNF.
    * Chart Builder.
    GGRAPH
      /GRAPHDATASET NAME="graphdataset" VARIABLES=Var1 MEAN(Count) MEAN(Count_B) MEAN(Count_A) 
        MISSING=LISTWISE REPORTMISSING=NO
        TRANSFORM=VARSTOCASES(SUMMARY="#SUMMARY" INDEX="#INDEX")
      /GRAPHSPEC SOURCE=INLINE.
    BEGIN GPL
      DATA: SUMMARY=col(source(s), name("#SUMMARY"))
      DATA: INDEX=col(source(s), name("#INDEX"), unit.category())
      GUIDE: axis(dim(1), label("Var1"))
      GUIDE: axis(dim(2), label("Mean"))
      GUIDE: legend(aesthetic(aesthetic.color.interior), label(""))
      GUIDE: text.title(label("Statements with percentages favorable, neutral and unfavorable"))
      SCALE: linear(dim(2), include(0))
      SCALE: cat(aesthetic(aesthetic.color.interior), include(
    "0", "1", "2"))
      ELEMENT: interval.stack(position(Var1*SUMMARY), color.interior(INDEX), 
        shape.interior(shape.square))
    END GPL.



    ------------------------------
    Jos Blykers
    ------------------------------



  • 4.  RE: "Diverging" Stacked Bar Charts

    Posted Wed November 01, 2023 04:14 AM

    @Rick Marcantonio Hi, Rick, could you have a fresh look at this?  I have been reading around, found no real solution, but guess that I would need to sort the data first on the variable value 'strongly agree' (for example) and that it is not during graph building that the sort is to be done. But I am not sure. I can provide a sample data set if needed to help you simulate the problem I have. Thanks a lot!  Jos Blykers



    ------------------------------
    Jos Blykers
    ------------------------------



  • 5.  RE: "Diverging" Stacked Bar Charts

    Posted Mon November 13, 2023 12:00 AM

    Hi , We are looking into your problem and it would be helpful if you can share sample dataset.



    ------------------------------
    [Aruna Saraswathy,] [Statistician]
    [SPSS Statistics]
    [IBM]
    ------------------------------



  • 6.  RE: "Diverging" Stacked Bar Charts

    Posted Mon November 13, 2023 05:35 AM

    Great, Aruna. Uploading two small test datasets and a Word-file with my step-by-step approach and what I want to achieve.



    ------------------------------
    Jos Blykers
    ------------------------------

    Attachment(s)

    sav
    Favunf.sav   1 KB 1 version
    sav
    Rivers.sav   1 KB 1 version
    docx
    For Aruna expertise.docx   142 KB 1 version


  • 7.  RE: "Diverging" Stacked Bar Charts

    Posted Wed November 15, 2023 07:37 AM
      |   view attached

    Hi Jos,

    the only change I made was to transpose the custom tables at output window and edited chart editor properties to get the desired sortable table. I am attaching the modified document you sent me , please checkout and feel free to post any other questions you may have.



    ------------------------------
    [Aruna Saraswathy,] [Statistician]
    [SPSS Statistics]
    [IBM]
    ------------------------------

    Attachment(s)

    docx
    For Aruna expertise_v2.docx   2.64 MB 1 version


  • 8.  RE: "Diverging" Stacked Bar Charts

    Posted Wed November 15, 2023 10:39 AM
      |   view attached

    That is great progress, thank you, Aruna. However, the last step did not work for me - and looking at your last graph - it did not work for you either. When I compare the requested sort with the actual graph, the sort was not executed correctly. I was able to follow and execute your steps. But the very last step does not give the required result in the graph, in other words, the statements are not sorted by the percentage strongly agree (or any other) in the graph. Can you have another look? Sending the attachment with my comments.  @Aruna Saraswathy



    ------------------------------
    Jos Blykers
    ------------------------------

    Attachment(s)

    docx
    For Aruna expertise_v3.docx   2.60 MB 1 version