Reputation: 95
I'm unable to find a way to create in SPSS a box & whisker plot with individual data points overlaid upon it like this:
I.e., similar to what one could achieve in R via the geom_jitter()
function in the ggplot2
package, as described in this post, but with SPSS--preferably via Syntax. Is this possible?
Upvotes: 1
Views: 4249
Reputation: 586
I don't think you can do this via the dialog boxes, but you can do it using the GGRAPH command and GPL (Graphics Programming Language). Here's an example. Open the Employee.sav file that comes installed with SPSS Statistics, open a syntax window and paste these commands in, then click Run>All:
GGRAPH
/GRAPHDATASET NAME="Employeedata" VARIABLES=jobcat salary
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s = userSource(id("Employeedata"))
DATA: jobcat = col(source(s), name("jobcat"), unit.category())
DATA: salary = col(source(s), name("salary"))
GUIDE: axis(dim(2), label("Current Salary"))
GUIDE: axis(dim(1), label("Job Category"))
GUIDE: form.line(position(*, 25000))
SCALE: linear(dim(2), include(0))
ELEMENT: schema(position(bin.quantile.letter(jobcat*salary)))
ELEMENT: point.dodge.symmetric(position(bin.dot(jobcat*salary,dim(2))),color(color.red))
END GPL.
I've included a reference line here, as is also in the original image.
Upvotes: 1