Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

placing a mean in the middle of eaach boxplot for multiple boxplots

2,971 views
Skip to first unread message

J9 Romano

unread,
May 25, 2009, 10:47:51 PM5/25/09
to
Does anyone know if there is a way one can graph the mean of group
within a boxplot. In other works the "middle" line of the boxplot is
the 50th percentile but I want to place a point within each boxplot
that displays will the mean. I know SPSS will allow you to place a
line in the plane that is the average but if you have more than one
group (i.e. more than one boxplot) this is the overall average. It is
possible to create boxplots like this in SAS so I am guessing it must
be possible in SPSS. Any ideas?

JKPeck

unread,
May 26, 2009, 9:25:25 AM5/26/09
to

Following is an example drawing a mean line. It uses the cars.sav
file shipped with SPSS.
The mean line is added by the second ELEMENT statement. If you want a
point instead, change interval to point. You might then want to
fiddle with the point size or symbol.

HTH,
Jon Peck

* boxplot with mean lines added.

GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=origin horse
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: origin=col(source(s), name("origin"), unit.category())
DATA: horse=col(source(s), name("horse"))
GUIDE: axis(dim(1), label("Country of Origin"))
GUIDE: axis(dim(2), label("Horsepower"))
SCALE: cat(dim(1), include("1", "2", "3"))
SCALE: linear(dim(2), include(0))
ELEMENT: schema(position(bin.quantile.letter(origin*horse)),size
(size."30px"))
ELEMENT: interval(position(region.spread.range(summary.mean
(origin*horse))),size(size."20px"))
END GPL.

0 new messages