<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to plot 3 variables on X-axis. in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401989#M13776</link>
    <description>&lt;P&gt;Perhaps something like this:&lt;/P&gt;
&lt;PRE&gt;Data dsn1;
input 
UID $2. Top Medium Low
;
cards;
WW	1	1	1	
O	1	1	1	
FF	2	1	0	
D	2	1	0	
Y	1	2	0	
BB	0	1	2	
R	1	1	1	
E	1	2	0	
AA	1	1	1	
OO	1	1	1	
T 	0	0	3	
CC	1	0	2	
;
run;
data dsntrans;
   set dsn1;
   array a top medium low;
   do i = 1 to dim(a);
      Grp = vname(a[i]);
      value = a[i];
      output;
   end;
   keep uid grp value;
run;

proc sgplot data = dsntrans;
vbar value/ stat = freq group=grp 
           datalabel
           groupdisplay=cluster;
run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Oct 2017 22:32:27 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-10-06T22:32:27Z</dc:date>
    <item>
      <title>How to plot 3 variables on X-axis.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401927#M13775</link>
      <description>&lt;P&gt;Hello SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for responding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if anyone could help me with plotting 3 variables namely Top Medium and Lowon X axis and Counts of those variables on Y-axis.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each variable( Top, Medium and Low) are expected to have 0 1 2 3 observations and I want to plot all 3 variables on X axis and the frequency of 0 1 2 3 on Y axis.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data dsn1;
input 
UID $2. Top Medium Low
;
cards;
WW	1	1	1	
O	1	1	1	
FF	2	1	0	
D	2	1	0	
Y	1	2	0	
BB	0	1	2	
R	1	1	1	
E	1	2	0	
AA	1	1	1	
OO	1	1	1	
T 	0	0	3	
CC	1	0	2	
;
run;

proc sgplot data = dsn1;
vbar Top/ stat = freq ;
run;

proc sgplot data = dsn1;
vbar Medium/ stat = freq ;
run;

proc sgplot data = dsn1;
vbar Low/ stat = freq ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please comment the possibility.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 22:46:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401927#M13775</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2017-10-06T22:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot 3 variables on X-axis.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401989#M13776</link>
      <description>&lt;P&gt;Perhaps something like this:&lt;/P&gt;
&lt;PRE&gt;Data dsn1;
input 
UID $2. Top Medium Low
;
cards;
WW	1	1	1	
O	1	1	1	
FF	2	1	0	
D	2	1	0	
Y	1	2	0	
BB	0	1	2	
R	1	1	1	
E	1	2	0	
AA	1	1	1	
OO	1	1	1	
T 	0	0	3	
CC	1	0	2	
;
run;
data dsntrans;
   set dsn1;
   array a top medium low;
   do i = 1 to dim(a);
      Grp = vname(a[i]);
      value = a[i];
      output;
   end;
   keep uid grp value;
run;

proc sgplot data = dsntrans;
vbar value/ stat = freq group=grp 
           datalabel
           groupdisplay=cluster;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 22:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401989#M13776</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-06T22:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot 3 variables on X-axis.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401995#M13777</link>
      <description>Hi Ballardw,&lt;BR /&gt;&lt;BR /&gt;Thank you for the quick reply and thank you for the solution.&lt;BR /&gt;I am sorry if was not clear with my question. Your solution give me an output of 0 1 2 3 on X axis. I was expecting Top medium and Low on X axis and they are further sub grouped into 0 1 2 3.&lt;BR /&gt;I am sorry for not being clear.&lt;BR /&gt;I appreciate your help.</description>
      <pubDate>Fri, 06 Oct 2017 22:40:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401995#M13777</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2017-10-06T22:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot 3 variables on X-axis.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401996#M13778</link>
      <description>&lt;P&gt;Try these:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data dsn2;
set dsn1;
length grp $10;
grp = "Low";
value = low;
output;
grp = "Medium";
value = medium;
output;
grp = "Top";
value = top;;
output;
run;

proc sgplot data = dsn2;
vbar value/ stat = freq group=grp groupdisplay=stack grouporder=data ;
run;

/* Or */
proc sgplot data = dsn2;
vbar value/ stat = freq group=grp groupdisplay=cluster grouporder=data ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 22:41:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401996#M13778</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-10-06T22:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot 3 variables on X-axis.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401998#M13779</link>
      <description>Hi PGStats,&lt;BR /&gt;&lt;BR /&gt;Thank you for your solution.&lt;BR /&gt;I appreciate your help.&lt;BR /&gt;I am sorry if was not clear with my question.&lt;BR /&gt;I was expecting Top Medium and Low in X axis which are futher each sub classified into 0 1 2 3. Just like the merging the outputs of my 3 Sgplots.</description>
      <pubDate>Fri, 06 Oct 2017 22:45:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401998#M13779</guid>
      <dc:creator>shasank</dc:creator>
      <dc:date>2017-10-06T22:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot 3 variables on X-axis.</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401999#M13780</link>
      <description>&lt;P&gt;Maybe this (third option)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dsn2;
set dsn1;
length grp $10;
grp = "Low";
value = low;
output;
grp = "Medium";
value = medium;
output;
grp = "Top";
value = top;;
output;
run;

proc sgplot data = dsn2;
vbar value/ stat = freq group=grp groupdisplay=stack grouporder=data ;
run;

/* Or */
proc sgplot data = dsn2;
vbar value/ stat = freq group=grp groupdisplay=cluster grouporder=data ;
run;

/* Or */
proc sgpanel data=dsn2;
panelby grp / rows=1;
vbar value / stat=freq;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 22:46:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-plot-3-variables-on-X-axis/m-p/401999#M13780</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-10-06T22:46:22Z</dc:date>
    </item>
  </channel>
</rss>

