Chart Builder - Rows Panel Variable

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Chart Builder - Rows Panel Variable

Brad
Hi, I'm using 'rows panel variable' to break my histogram into categories
(to show a separate histogram for each category on the rows panel
variable). The problem is that each histogram for each category shows
columns with empty data for that category.

I'm looking for something like the option to select 'show only categories
present in the data', except I need to do this for 'show only rows present
in the category'... but I don't see this as an option anywhere in the
menu's. Is there a syntax based solution?

The syntax for the chart is:

* Chart Builder.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=BNFParagraphDescription COUNT
()[name="COUNT"] BNFSectionDescription MISSING=LISTWISE REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: BNFParagraphDescription=col(source(s), name
("BNFParagraphDescription"), unit.category())
  DATA: COUNT=col(source(s), name("COUNT"))
  DATA: BNFSectionDescription=col(source(s), name
("BNFSectionDescription"), unit.category())
  COORD: rect(dim(1,2), transpose())
  GUIDE: axis(dim(1), label("BNFParagraphDescription"))
  GUIDE: axis(dim(2), label("Count"))
  GUIDE: axis(dim(4), label("BNFSectionDescription"), opposite())
  GUIDE: text.title(label("Drugs Dispensed to Diabetic SMR01 Patients"))
  SCALE: linear(dim(2), include(0))
  ELEMENT: interval(position
(BNFParagraphDescription*COUNT*1*BNFSectionDescription), shape.interior
(shape.square))
END GPL.

Hope that makes sense!

Thanks for your time

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: Chart Builder - Rows Panel Variable

Jon K Peck
What you need is a nest operator instead of a cross.  Nesting gives you just the categories that occur together.  Something like this, which uses the employee data.sav file shipped with the software.

RAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=educ COUNT()[name="COUNT"] jobcat MISSING=LISTWISE
    REPORTMISSING=NO
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: educ=col(source(s), name("educ"), unit.category())
  DATA: COUNT=col(source(s), name("COUNT"))
  DATA: jobcat=col(source(s), name("jobcat"), unit.category())
  GUIDE: axis(dim(1), label("Educational Level (years)"))
  GUIDE: axis(dim(2), label("Count"))
  GUIDE: axis(dim(3), label("Employment Category"), opposite())
  SCALE: cat(dim(1))
  SCALE: linear(dim(2), include(0))
  SCALE: cat(dim(3), include("1", "2", "3"))
  ELEMENT: interval(position(educ/jobcat*COUNT), shape.interior(shape.square))
END GPL.

It appears that you are actually doing bar charts, not histograms from the syntax below.

HTH,

Jon Peck
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        Brad <[hidden email]>
To:        [hidden email]
Date:        08/09/2011 08:10 AM
Subject:        [SPSSX-L] Chart Builder - Rows Panel Variable
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Hi, I'm using 'rows panel variable' to break my histogram into categories
(to show a separate histogram for each category on the rows panel
variable). The problem is that each histogram for each category shows
columns with empty data for that category.

I'm looking for something like the option to select 'show only categories
present in the data', except I need to do this for 'show only rows present
in the category'... but I don't see this as an option anywhere in the
menu's. Is there a syntax based solution?

The syntax for the chart is:

* Chart Builder.
GGRAPH
 /GRAPHDATASET NAME="graphdataset" VARIABLES=BNFParagraphDescription COUNT
()[name="COUNT"] BNFSectionDescription MISSING=LISTWISE REPORTMISSING=NO
 /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
 SOURCE: s=userSource(id("graphdataset"))
 DATA: BNFParagraphDescription=col(source(s), name
("BNFParagraphDescription"), unit.category())
 DATA: COUNT=col(source(s), name("COUNT"))
 DATA: BNFSectionDescription=col(source(s), name
("BNFSectionDescription"), unit.category())
 COORD: rect(dim(1,2), transpose())
 GUIDE: axis(dim(1), label("BNFParagraphDescription"))
 GUIDE: axis(dim(2), label("Count"))
 GUIDE: axis(dim(4), label("BNFSectionDescription"), opposite())
 GUIDE: text.title(label("Drugs Dispensed to Diabetic SMR01 Patients"))
 SCALE: linear(dim(2), include(0))
 ELEMENT: interval(position
(BNFParagraphDescription*COUNT*1*BNFSectionDescription), shape.interior
(shape.square))
END GPL.

Hope that makes sense!

Thanks for your time

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