Multiple Graphs in One

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple Graphs in One

kristinelaudencia
It's been years since I used SPSS and now I have to use it again on a study conducted where I work.

I'm trying to create a graph that will display three variables, e.g.:
1. First month - ability to use the system
2. After 3 months - ability to use the system
3. After 6 months - ability to use the system

All with 5-point Likert scale Poor, Fairy, Average, Very Good, Excellent.

How can I display that the X axis will be the Likert Scale and the clustered bar graphs will be the N or % of those who answered poor for the first month, after 3 months, and after 6 months, fair for the first month, after 3 months and after 6 months, and so on?
Reply | Threaded
Open this post in threaded view
|

Re: Multiple Graphs in One

Andy W

It is useful to know how your data are currently set up, but if your panel data are in long format this is easier to generate this graph through the GUI dialog for GGRAPH. Because this is not how people typically have their data formatted, I generate some fake data in wide format and then transform it to long format and generate the requested graph. I have attached a picture (only slightly edited post-hoc + my personal chart template) from what is produced by the GGRAPH command.

set seed = 10.
input program.
loop #i = 1 to 100.
compute case = #i.
end case.
end loop.
end file.
end input program.
dataset name sim.
execute.
vector V1_M(3,F1.0).
do repeat V1_M = V1_M1 to V1_M3.
compute V1_M = TRUNC(RV.UNIFORM(1,6)).
end repeat.

value labels V1_M1 to V1_M3
1 'Poor'
2 'Fairy'
3 'Average'
4 'Very Good'
5 'Excellent'.

varstocases
/make V1 from V1_M1 to V1_M3
/index = wave.

value labels wave
1 'First Month'
2 '3 Months'
3 '6 Months'.

DATASET ACTIVATE sim.
* Chart Builder.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=wave COUNT()[name="COUNT"] V1 MISSING=LISTWISE
REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: wave=col(source(s), name("wave"), unit.category())
DATA: COUNT=col(source(s), name("COUNT"))
DATA: V1=col(source(s), name("V1"), unit.category())
GUIDE: axis(dim(1), label("Wave"))
GUIDE: axis(dim(2), label("Percent"))
GUIDE: legend(aesthetic(aesthetic.color.interior), label("V1"))
SCALE: linear(dim(2), include(0))
SCALE: cat(aesthetic(aesthetic.color.interior), include("1", "2", "3", "4", "5"))
ELEMENT: line(position(summary.percent(wave*COUNT, base.coordinate(dim(1)))), color.interior(V1),
missing.wings())
END GPL.

Andy W
apwheele@gmail.com
http://andrewpwheeler.wordpress.com/