ggraph/gpl question

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ggraph/gpl question

Sarraf, Shimon Aaron
Hello:

I wonder if anyone has encountered a similar issue with GGRAPH/GPL syntax that I'm currently facing. I’ve pasted below two pieces of syntax that create line graphs. The first gives the average retention rate by three income categories. The second attempts to include information by “ability” as well, so there would be a line for three different ability groups plus a total line. My assumption is that the two pieces of syntax would create identical results for the total line, but, in fact, the top 25% income group shows different retention rates (96% versus 94%). Other charts based on variables besides income produce similar discrepancies.

Any ideas on what might be driving this difference? Using the ability variable appears to shift the overall retention results to something I cannot replicate with simple syntax (mean retention by income by ability). There is no missing data for ability, so I don't believe this is a listwise deletion issue.

Any assistance with understanding this discrepancy and how to correct it is much appreciated.

Take care,

Shimon

*Without ability lines.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Income [LEVEL=NOMINAL] MEAN(reten)[name="Retention"]  MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE TEMPLATE="C:\temp\template1.sgt".
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: Income=col(source(s), name("Income"), unit.category())
  DATA: Retention=col(source(s), name("Retention"))
  GUIDE: axis(dim(1), label("Income Categories"))
  GUIDE: axis(dim(2), label("Retention"))
  SCALE: cat(dim(1), include("1.00", "2.00", "3.00"))
  SCALE: linear(dim(2), include(0))
  ELEMENT: line(position(summary.mean(Income*Retention)), color(color.red))
END GPL.

*With ability lines.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Income [LEVEL=NOMINAL] MEAN(reten)[name="Retention"]  Abilitycat[LEVEL=NOMINAL] MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE TEMPLATE="C:\temp\template1.sgt".
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: Income=col(source(s), name("Income"), unit.category())
  DATA: Retention=col(source(s), name("Retention"))
  DATA: Abilitycat=col(source(s), name("Abilitycat"), unit.category())
  GUIDE: axis(dim(1), label("Income Categories"))
  GUIDE: axis(dim(2), label("Retention"))
  GUIDE: legend(aesthetic(aesthetic.color.interior), label("Pre-College Ability"))
  SCALE: cat(dim(1), include("1.00", "2.00", "3.00"))
  SCALE: linear(dim(2), include(0))
  SCALE: cat(aesthetic(aesthetic.color.interior), include("3.00", "2.00", "1.00"), sort.values("3.00", "2.00", "1.00"))
  ELEMENT: line(position(Income*Retention), color.interior(Abilitycat))
  ELEMENT: line(position(summary.mean(Income*Retention)), color(color.red))
END GPL.

=====================
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