<?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: HELP: HBAR GRAPH in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61767#M2084</link>
    <description>Many thanks Bill, I'll try with your suggestion&lt;BR /&gt;
&lt;BR /&gt;
Have a good time</description>
    <pubDate>Wed, 04 May 2011 16:58:12 GMT</pubDate>
    <dc:creator>L_L</dc:creator>
    <dc:date>2011-05-04T16:58:12Z</dc:date>
    <item>
      <title>HELP: HBAR GRAPH</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61765#M2082</link>
      <description>Dear all,&lt;BR /&gt;
I'm analyzing data for an observational study and I wuold like to present&lt;BR /&gt;
some data in a horizontal bar chart.&lt;BR /&gt;
A data example is:&lt;BR /&gt;
&lt;BR /&gt;
Cod   Var_strat     Exam1     Exam2   Exam3&lt;BR /&gt;
1       green              Yes       No         No&lt;BR /&gt;
2       red                  Yes       No         Yes&lt;BR /&gt;
3       red                  No        Yes        No&lt;BR /&gt;
4       green              Yes       No         Yes&lt;BR /&gt;
&lt;BR /&gt;
I would like to create a graph with the percentage of "Yes" for the three dichotomic variables (exam1 exam2 exam3)  stratified by  the variable "Var_strat" (green or red).&lt;BR /&gt;
&lt;BR /&gt;
Anyone could help me?&lt;BR /&gt;
Thanks in advance</description>
      <pubDate>Wed, 04 May 2011 09:31:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61765#M2082</guid>
      <dc:creator>L_L</dc:creator>
      <dc:date>2011-05-04T09:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: HELP: HBAR GRAPH</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61766#M2083</link>
      <description>First you will need to produce counts for the various combinations.  Here's a proc freq method for exam1&lt;BR /&gt;
&lt;BR /&gt;
proc freq;                                                                                                                              &lt;BR /&gt;
table var_strat*exam1/out=exam1 noprint;;                                                                                               &lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Put all the exam counts together in a data step and then you will be ready to move on to producing the chart with something like this;&lt;BR /&gt;
&lt;BR /&gt;
proc gchart;                                                                                                                            &lt;BR /&gt;
where exam1='Yes';                                                                                                                      &lt;BR /&gt;
hbar var_strat/group=exam1 freq=percent;                                                                                                &lt;BR /&gt;
run;</description>
      <pubDate>Wed, 04 May 2011 13:47:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61766#M2083</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2011-05-04T13:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: HELP: HBAR GRAPH</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61767#M2084</link>
      <description>Many thanks Bill, I'll try with your suggestion&lt;BR /&gt;
&lt;BR /&gt;
Have a good time</description>
      <pubDate>Wed, 04 May 2011 16:58:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61767#M2084</guid>
      <dc:creator>L_L</dc:creator>
      <dc:date>2011-05-04T16:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: HELP: HBAR GRAPH</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61768#M2085</link>
      <description>I run a proc freq keeping the variabile I need (row percent). Now I've this file:&lt;BR /&gt;
TEST DATA SET&lt;BR /&gt;
Var_strat   rowpercent               esame&lt;BR /&gt;
Disease1	8.771929825	Esame1&lt;BR /&gt;
Disease2	2.788844622	Esame1&lt;BR /&gt;
Disease1	42.98245614	Esame2&lt;BR /&gt;
Disease2	55.97609562	Esame2&lt;BR /&gt;
Disease1	5.219298246	Esame3&lt;BR /&gt;
Disease2	7.199203187	Esame3&lt;BR /&gt;
&lt;BR /&gt;
I'll try with this code:&lt;BR /&gt;
&lt;BR /&gt;
data test1;&lt;BR /&gt;
set test;&lt;BR /&gt;
length color $50.;&lt;BR /&gt;
if var_strat='Disease1' then color='Disease1';&lt;BR /&gt;
else color='Disease2';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
pattern1 c=red;&lt;BR /&gt;
pattern2 c=blue;&lt;BR /&gt;
&lt;BR /&gt;
goptions reset=global gunit=pct border cback=white&lt;BR /&gt;
         ctext=black &lt;BR /&gt;
         ftext=swiss ftitle=swissb&lt;BR /&gt;
         htitle=6 htext=3.5;&lt;BR /&gt;
&lt;BR /&gt;
 legend1 cborder=black&lt;BR /&gt;
        label=none&lt;BR /&gt;
        mode=protect&lt;BR /&gt;
        across=1;&lt;BR /&gt;
 axis2 label=none;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc gchart; &lt;BR /&gt;
hbar var_strat/&lt;BR /&gt;
group=esame &lt;BR /&gt;
freq=rowpercent &lt;BR /&gt;
subgroup=color &lt;BR /&gt;
width=8 &lt;BR /&gt;
space=0&lt;BR /&gt;
coutline=black &lt;BR /&gt;
maxis=axis2&lt;BR /&gt;
frame raxis=0 to 100 by 10 minor=0 &lt;BR /&gt;
legend=legend1&lt;BR /&gt;
run; &lt;BR /&gt;
&lt;BR /&gt;
1) I would like to add the rowpercent value inside the HBAR: how can I do it?&lt;BR /&gt;
&lt;BR /&gt;
2) I would like not to display in axis2 the name of var_strat (disease1, disease2)  but only the name of the variable "esame"&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: L&amp;amp;L

Message was edited by: L&amp;amp;L</description>
      <pubDate>Fri, 06 May 2011 13:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61768#M2085</guid>
      <dc:creator>L_L</dc:creator>
      <dc:date>2011-05-06T13:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: HELP: HBAR GRAPH</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61769#M2086</link>
      <description>L &amp;amp; L;&lt;BR /&gt;
&lt;BR /&gt;
I've made a few tweaks to make it work for me.&lt;BR /&gt;
&lt;BR /&gt;
1 Move the pattern statements to after the goptions reset (you've avoided the red / green combination - that's a good thing)&lt;BR /&gt;
2 Remove the legend (direct labeling is superior to legend "labeling")&lt;BR /&gt;
3 Removed the coutline - it's just ink with no added value&lt;BR /&gt;
&lt;BR /&gt;
Hbar charts (in 9.1 at least) do not support values inside or outside of the bars.  The values are already listed on the right.&lt;BR /&gt;
&lt;BR /&gt;
DATA test;                                                                                                                              &lt;BR /&gt;
input Var_strat $ rowpercent esame $;                                                                                                   &lt;BR /&gt;
cards;                                                                                                                                  &lt;BR /&gt;
Disease1 8.771929825 Esame1                                                                                                             &lt;BR /&gt;
Disease2 2.788844622 Esame1                                                                                                             &lt;BR /&gt;
Disease1 42.98245614 Esame2                                                                                                             &lt;BR /&gt;
Disease2 55.97609562 Esame2                                                                                                             &lt;BR /&gt;
Disease1 5.219298246 Esame3                                                                                                             &lt;BR /&gt;
Disease2 7.199203187 Esame3                                                                                                             &lt;BR /&gt;
;                                                                                                                                       &lt;BR /&gt;
run;                                                                                                                                    &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
data test1;                                                                                                                             &lt;BR /&gt;
set test;                                                                                                                               &lt;BR /&gt;
length color $50.;                                                                                                                      &lt;BR /&gt;
if var_strat='Disease1' then color='Disease1';                                                                                          &lt;BR /&gt;
else color='Disease2';                                                                                                                  &lt;BR /&gt;
run;                                                                                                                                    &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
goptions reset=global gunit=pct border cback=white                                                                                      &lt;BR /&gt;
ctext=black                                                                                                                             &lt;BR /&gt;
ftext=swiss ftitle=swissb                                                                                                               &lt;BR /&gt;
htitle=6 htext=3.5                                                                                                                      &lt;BR /&gt;
dev=win;                                                                                                                                &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
pattern1 c=red;                                                                                                                         &lt;BR /&gt;
pattern2 c=blue;                                                                                                                        &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
legend1 cborder=black                                                                                                                   &lt;BR /&gt;
label=none                                                                                                                              &lt;BR /&gt;
mode=protect                                                                                                                            &lt;BR /&gt;
across=1;                                                                                                                               &lt;BR /&gt;
axis2 label=none;                                                                                                                       &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
                                                                                                                                        &lt;BR /&gt;
proc gchart;                                                                                                                            &lt;BR /&gt;
hbar var_strat/                                                                                                                         &lt;BR /&gt;
group=esame                                                                                                                             &lt;BR /&gt;
freq=rowpercent                                                                                                                         &lt;BR /&gt;
subgroup=color                                                                                                                          &lt;BR /&gt;
width=8                                                                                                                                 &lt;BR /&gt;
space=0                                                                                                                                 &lt;BR /&gt;
/*coutline=black*/                                                                                                                      &lt;BR /&gt;
maxis=axis2                                                                                                                             &lt;BR /&gt;
frame raxis=0 to 100 by 10 minor=0                                                                                                      &lt;BR /&gt;
nolegend;                                                                                                                               &lt;BR /&gt;
run;</description>
      <pubDate>Mon, 09 May 2011 14:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61769#M2086</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2011-05-09T14:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: HELP: HBAR GRAPH</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61770#M2087</link>
      <description>Dear Bill,&lt;BR /&gt;
&lt;BR /&gt;
Thank you so much for your reply!&lt;BR /&gt;
&lt;BR /&gt;
:-))</description>
      <pubDate>Mon, 09 May 2011 19:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/HELP-HBAR-GRAPH/m-p/61770#M2087</guid>
      <dc:creator>L_L</dc:creator>
      <dc:date>2011-05-09T19:56:49Z</dc:date>
    </item>
  </channel>
</rss>

