If you just want to do a clustered bar chart this is actually easy via the

legacy graph commands. Below I show that and some other ways to do it via

GGRAPH.

*********************************************************************************************.

DATA LIST FREE / Cat (A1) V1 V2 (2F3.0).

BEGIN DATA

A 40 30

B 20 60

C 10 40

END DATA.

DATASET NAME Bars.

GRAPH /BAR(GROUPED)=MEAN(V1) MEAN(V2) BY Cat.

*GGRAPH code examples.

*Superimposed points.

GGRAPH

/GRAPHDATASET NAME="graphdataset" VARIABLES=Cat V1 V2

/GRAPHSPEC SOURCE=INLINE.

BEGIN GPL

SOURCE: s=userSource(id("graphdataset"))

DATA: Cat=col(source(s), name("Cat"), unit.category())

DATA: V1=col(source(s), name("V1"))

DATA: V2=col(source(s), name("V2"))

GUIDE: axis(dim(1), label("Cat"))

GUIDE: axis(dim(2), label("Y Value"))

SCALE: linear(dim(2), include(0))

ELEMENT: point(position(Cat*V2), size(size."12"), shape("V2"),

color.interior("V2"))

ELEMENT: point(position(Cat*V1), size(size."12"), shape("V1"),

color.interior("V1"))

END GPL.

*Might want to also dodge if many points are overlapping, see.

*

https://andrewpwheeler.wordpress.com/2013/03/06/some-random-spss-graph-tips-shading-areas-under-curves-and-using-dodging-in-binned-dot-plots/.

*Would need to reshape though wide to long to do that.

*Dodged dot plot with connecting edge.

GGRAPH

/GRAPHDATASET NAME="graphdataset" VARIABLES=Cat MEAN(V1) MEAN(V2)

TRANSFORM=VARSTOCASES(SUMMARY="MaxBar" INDEX="V")

/GRAPHSPEC SOURCE=INLINE

/FRAME INNER=YES.

BEGIN GPL

SOURCE: s=userSource(id("graphdataset"))

DATA: Cat=col(source(s), name("Cat"), unit.category())

DATA: V=col(source(s), name("V"), unit.category())

DATA: MaxBar=col(source(s), name("MaxBar"))

TRANS: base = eval(0)

COORD: rect(dim(1,2), cluster(3))

GUIDE: axis(dim(1), label("Cat"))

GUIDE: axis(dim(2), label("Y Value"))

SCALE: linear(dim(2), include(0))

ELEMENT: edge(position(V*(base + MaxBar)*Cat), color(V))

ELEMENT: point(position(V*MaxBar*Cat), size(size."12"), shape(V),

color.interior(V))

END GPL.

*********************************************************************************************.

-----

Andy W

[hidden email]
http://andrewpwheeler.wordpress.com/--

Sent from:

http://spssx-discussion.1045642.n5.nabble.com/=====================

To manage your subscription to SPSSX-L, send a message to

[hidden email] (not to SPSSX-L), with no body text except the

command. To leave the list, send the command

SIGNOFF SPSSX-L

For a list of commands to manage subscriptions, send the command

INFO REFCARD