Data visualization with SAS programming

GTL needleplot groupdisplay in SAS 9.3

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

GTL needleplot groupdisplay in SAS 9.3

Hi!

I would like to create a graph as follow by using the groupdisplay tag.

Is this possible and how?

furniture_example.png

And if I change gtl tag to barchart would this be possible?

Documentation info can be found here:

http://support.sas.com/documentation/cdl/en/grstatgraph/65377/HTML/default/viewer.htm#p0dcix1s0khu6f...

Thanks in advance,

Best regards

Paolo Santin

Attachment

Accepted Solutions
Solution
‎11-09-2012 10:47 AM
SAS Super FREQ
Posts: 1,040

Re: GTL needleplot groupdisplay in SAS 9.3

NEEDLEPLOT does not allow stacked groups.  The only benefit I see of using needle instead of barchartis that you can have an interval X axis, since bar chart always makes the axis discrete.  If that is your aim, you can use the HIGHLOWPLOT with default TYPE=LINE.  You will have to compute the high and low values yourself based on the stacking you want.  You can also use the HIGHLOWBAR with TYPE=BAR with a linear axis.  This will give you the "bar" look with fills and outlines, but these type of plot (HighLowPlot or NeedlePlot) do not summarize your data.  You can also do this in SGPLOT.

Another alternative is to use the VECTORPLOT.

View solution in original post


All Replies
SAS Super FREQ
Posts: 1,040

Re: GTL needleplot groupdisplay in SAS 9.3


Yes, you can do this using GTL BARCHART.  The bar chart can have only ONE group role which can either be Clustered or Stacked.  So in your case split your data into two response columns, one for the "1" data and one for the "2" data.  Then, use a stacked bar chart.for the "1" values with a negative discrete offset.  Overlay another stacked bar chart for the "2" with positive discrete offset.  Set bar widths to 0.5 or less.

Occasional Contributor
Posts: 9

Re: GTL needleplot groupdisplay in SAS 9.3

Hi Sanjay and thank you for your answer!

I wonder if it's possible to do the same thing with the needleplot tag instead.

I should use the groupdisplay option but I couldn't make it work.

Do you know how to obtain such a result?

Thank you in advance!

Br,

Paolo

Solution
‎11-09-2012 10:47 AM
SAS Super FREQ
Posts: 1,040

Re: GTL needleplot groupdisplay in SAS 9.3

NEEDLEPLOT does not allow stacked groups.  The only benefit I see of using needle instead of barchartis that you can have an interval X axis, since bar chart always makes the axis discrete.  If that is your aim, you can use the HIGHLOWPLOT with default TYPE=LINE.  You will have to compute the high and low values yourself based on the stacking you want.  You can also use the HIGHLOWBAR with TYPE=BAR with a linear axis.  This will give you the "bar" look with fills and outlines, but these type of plot (HighLowPlot or NeedlePlot) do not summarize your data.  You can also do this in SGPLOT.

Another alternative is to use the VECTORPLOT.

Occasional Contributor
Posts: 9

Re: GTL needleplot groupdisplay in SAS 9.3

Thank you very much!

Post a Question
Discussion Stats
  • 4 replies
  • 415 views
  • 3 likes
  • 2 in conversation