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
Original Message:
Sent: Wed November 15, 2023 07:36 AM
From: Aruna Saraswathy
Subject: "Diverging" Stacked Bar Charts
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]
Original Message:
Sent: Mon November 13, 2023 05:34 AM
From: Jos Blykers
Subject: "Diverging" Stacked Bar Charts
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
Original Message:
Sent: Sun November 12, 2023 11:59 PM
From: Aruna Saraswathy
Subject: "Diverging" Stacked Bar Charts
Hi , We are looking into your problem and it would be helpful if you can share sample dataset.
------------------------------
[Aruna Saraswathy,] [Statistician]
[SPSS Statistics]
[IBM]
Original Message:
Sent: Wed November 01, 2023 04:14 AM
From: Jos Blykers
Subject: "Diverging" Stacked Bar Charts
@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
Original Message:
Sent: Tue October 17, 2023 05:36 AM
From: Jos Blykers
Subject: "Diverging" Stacked Bar Charts
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
Original Message:
Sent: Mon March 27, 2023 02:36 AM
From: Hanna Mag
Subject: "Diverging" Stacked Bar Charts
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
------------------------------