Hi!
I would like to create a graph as follow by using the groupdisplay tag.
Is this possible and how?
And if I change gtl tag to barchart would this be possible?
Documentation info can be found here:
Thanks in advance,
Best regards
Paolo Santin
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.
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.
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
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.
Thank you very much!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.