Also, if all of that seems too confusing, you could use this syntax:
GRAPH
/BAR(SIMPLE)=PGT(1)(yn1) PGT(1)(yn2) PGT(1)(yn3) PGT(1)(yn4) PGT(1)(yn5) PGT(1)(yn6) PGT(1)(yn7) PGT(1)(yn8)
/MISSING=LISTWISE.
Just change out "yn1" to "yn8" for your variables names, and this should work just as well (still assuming you defined 0=No and 1=Yes).
Main Topics
Browse All Topics





by: richdiesalPosted on 2009-08-19 at 11:13:36ID: 25135597
To the moderator: I have an SPSS alert, but it didn't go off until a couple of hours before your community alert did.
Now, to mharcais...
Yes, you can, but the output is not exactly what you'd think.
For this explanation, I'm going to assume you used code 1=Yes and 0=No for 8 variables called yn1, yn2, yn3...yn8. You'd need to adjust the procedure slightly depending on differences in your own dataset.
1) Go to Bar under the Graphs menu (might be under "Legacy Dialogs" depending on your version)
-- Bar Charts Dialog --
2) Select "Summaries of separate variables" at the bottom
3) Click on "Simple"
4) Click on "Define"
-- Define Simple Bar Dialog --
5) Put yn1 to yn8 in "Bars Represent"
6) While yn1 to yn8 are still highlighted under Bars Represent, click on "Change Statistic..."
-- Statistics Dialog --
7) Click on "Percentage Above"
8) Next to Value, type "0"
9) Click on "Continue"
-- Define Simple Bar Dialog (again) --
10) Click on "OK"
-- Output Pane --
11) This graph displays all of your variables, with the percentage "Yes" in each.
12) You will probably, at the bare minimum, want to change the y-axis label ("% > 1"), which you can do by double-clicking on the chart to open the Chart Editor, clicking once on the axis label, waiting a second, and then clicking on the label again.
I will add that if your values are currently text (e.g. if you actually have "Yes" and "No" in your dataset rather than numerical representations), you'll need to use the variable recode functions (under Transform) to turn them into numbers, otherwise SPSS will have no way to know that you specifically want to analyze "Yes" instead of "No."