CTABLES sorting categories by summary of another variable?

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

CTABLES sorting categories by summary of another variable?

ChrisKeran
Is there syntax which can sort categories in a CTABLE by the statistic of
another variable, similar to how GPL uses the PGT and sort.statistic
functions?

For example, this GGRAPH and GPL syntax correctly sorts MemberType by the
percentage of each MemberType who are abstract authors. However, I tried
something similar with CTABLES and received the error found below the
CTABLES syntax.

*************AbstractAuthor by Member Type.
* Chart Builder.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=Member_Type[LEVEL=NOMINAL]
*PGT(AbstractAuthor, 0)*[name="AbstractAuthor"]
    REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: Member_Type=col(source(s), name("Member_Type"), unit.category())
  DATA: AbstractAuthor=col(source(s), name("AbstractAuthor"))
  DATA: Type=col(source(s), name("Type"), unit.category())
  COORD: rect(dim(1,2), transpose())
  GUIDE: axis(dim(2), label("Percent Yes"))
  GUIDE: text.title(label("Percent of members who submitted an abstract BY
Member_Type."))
  SCALE: cat(dim(1), *sort.statistic(summary.percent(AbstractAuthor))*)
  SCALE: linear(dim(2), min(0), max(100))  
  ELEMENT: interval(position(Member_Type*AbstractAuthor),
shape.interior(shape.square))
END GPL.

* Custom Tables.
CTABLES
  /VLABELS VARIABLES=Member_Type AbstractAuthor DISPLAY=NONE
  /TABLE Member_Type [C] BY AbstractAuthor [C][COUNT COMMA40.0, ROWPCT.COUNT
'Row %' PCT40.0, TOTALS[COUNT COMMA40.0]]
  /CATEGORIES VARIABLES=Member_Type ORDER=A *KEY=PGT(AbstractAuthor, 0)*
EMPTY=INCLUDE TOTAL=YES POSITION=AFTER
  /CATEGORIES VARIABLES=AbstractAuthor ORDER=D KEY=VALUE EMPTY=INCLUDE
TOTAL=YES POSITION=AFTER
  /CRITERIA CILEVEL=95
  /TITLES
    TITLE='Percent of members who submitted an abstract BY Member_Type'.

**********Here is the error...
Warnings
CATEGORIES: Text PGT. An invalid subcommand, keyword, or option was
specified.
Execution of this command stops.




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