How to use respondents not responses as denominator for ggraph?

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

How to use respondents not responses as denominator for ggraph?

ChrisKeran
I have a multiple response variable "$Q1.2=Role" and when I create a simple
bar percent of Role using GGRAPH from the menus, the denominator is using
the number of responses and I need it to use the count (respondents)
instead. For example, there are 589 respondents and there are 780 responses
(they could choose more than one option). I want the percents based on the
589 and not the 780.

Just for laughs, I did try changing all instances of COUNT to RESPONDENTS,
but that gave me an unknown function error. Funny that when I tried
RESPONSES, it gave the same result as when using COUNT.

Here is the GGRAPH syntax...
* Chart Builder.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=$Q1.2[name="_Q1_2"]
COUNT()[name="COUNT"]
    MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: Q1_2=col(source(s), name("_Q1_2"), unit.category())
  DATA: COUNT=col(source(s), name("COUNT"))
  COORD: rect(dim(1,2), transpose())
  GUIDE: axis(dim(2), label("Percent"))
  GUIDE: text.title(label("Simple Bar Percent of Role"))
  SCALE: cat(dim(1), reverse(), include("Q1.2_1", "Q1.2_3", "Q1.2_2",
"Q1.2_6", "Q1.2_5", "Q1.2_4"
, "Q1.2_7", "Q1.2_8"), sort.values("Q1.2_1", "Q1.2_3", "Q1.2_2", "Q1.2_6",
"Q1.2_5", "Q1.2_4"
, "Q1.2_7", "Q1.2_8"))
  SCALE: linear(dim(2), include(0))
  ELEMENT: interval(position(summary.percent(Q1_2*COUNT,
base.all(acrossPanels()))),
    shape.interior(shape.square))
END GPL.



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