<?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: SGPLOT: yaxistable omits values in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-yaxistable-omits-values/m-p/427994#M14746</link>
    <description>&lt;P&gt;Thanks Reeza! It works but there must be another way to get the format printed? I have many No/Yes-categories so I will have to insert many invisible characters...&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2018 13:05:47 GMT</pubDate>
    <dc:creator>Riis</dc:creator>
    <dc:date>2018-01-16T13:05:47Z</dc:date>
    <item>
      <title>SGPLOT: yaxistable omits values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-yaxistable-omits-values/m-p/427860#M14735</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a forest plot of the estimates and 95% confidence limits in the dataset forestplot:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value group
1='Age'
2='&amp;lt;60 years'
3='&amp;gt;=60 years'
4='Sex'
5='Females'
6='Males'
7='Diabetes mellitus'
8='No'
9='Yes'
10='Hypertension'
11='No'
12='Yes'
13='Active smoking'
14='No'
15='Yes';
run;

data forestplot;
input group $1-18 est low up indent plot;
format est low up 5.1;
id=_n_;
idf=_n_;
format idf group.;
datalines;
Age                 .     .     .  . 1
&amp;lt;60 years         13.2  12.8  13.7 1 1
&amp;gt;=60 years        15.5  13.2  18.1 1 1
Sex                 .     .     .  . 1
Females           13.8  13.3  14.4 1 1
Males             14.7  14.1  15.4 1 1
Diabetes mellitus   .     .     .  . 2
No                14.1  13.6  14.5 1 2
Yes               16.4  14.7  18.1 1 2
Hypertension        .     .     .  . 3
No                11.4  10.9  11.9 1 3
Yes               18.1  17.4  18.8 1 3
Active smoking      .     .     .  . 4
No                13.5  13.1  14.0 1 4
Yes               16.1  15.1  17.0 1 4
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code almost does the trick:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let gpath=C:\SAS\;
ods _all_ close; 
ods listing;
ods listing gpath="&amp;amp;gpath" style=journal image_dpi=200;

ods graphics / reset=index imagename="Forest plot" imagefmt=png border=off width=400px height=400px;
title1 "Proportion (%) (95% CI)";
proc sgplot data=forestplot noautolegend nocycleattrs nowall noborder; 
	scatter y=group x=est / markerattrs=graphdata2(symbol=squarefilled) xerrorupper=up xerrorlower=low errorbarattrs=(color=black);
	yaxistable group / y=group location=inside position=left labelattrs=(size=7) indentweight=indent label='Category';
	refline 10 20 30 / axis=x lineattrs=(pattern=shortdash) transparency=0.5 noclip;
	xaxis max=30 minor display=(nolabel)  valueattrs=(size=7);
  yaxis display=none fitpolicy=none reverse;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Except that the estimates are grouped for the categories ‘No’ and ‘Yes’:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Forest plot.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17895i11593788A92600FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Forest plot.png" alt="Forest plot.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;To work around this, I used the id variable, which plots only a single estimate per row:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics / reset=index imagename="Forest plot raw" imagefmt=png border=off width=400px height=400px;
title1 "Proportion (%) (95% CI)";
proc sgplot data=forestplot noautolegend nocycleattrs nowall noborder; 
	scatter y=id x=est / markerattrs=graphdata2(symbol=squarefilled) xerrorupper=up xerrorlower=low errorbarattrs=(color=black);
	yaxistable id / y=id location=inside position=left labelattrs=(size=7) indentweight=indent label='Category';
	refline 10 20 30 / axis=x lineattrs=(pattern=shortdash) transparency=0.5 noclip;
	xaxis max=30 minor display=(nolabel)  valueattrs=(size=7);
  yaxis display=none fitpolicy=none reverse;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Forest plot raw.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17896iAF1F3B891B37895F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Forest plot raw.png" alt="Forest plot raw.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then it should be easy to use a format to get the text label instead of the id numbers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics / reset=index imagename="Forest plot formatted" imagefmt=png border=off width=400px height=400px;
title1 "Proportion (%) (95% CI)";
proc sgplot data=forestplot noautolegend nocycleattrs nowall noborder; 
	scatter y=id x=est / markerattrs=graphdata2(symbol=squarefilled) xerrorupper=up xerrorlower=low errorbarattrs=(color=black);
	yaxistable id / y=id location=inside position=left labelattrs=(size=7) indentweight=indent label='Category';
	refline 10 20 30 / axis=x lineattrs=(pattern=shortdash) transparency=0.5 noclip;
	xaxis max=30 minor display=(nolabel)  valueattrs=(size=7);
  yaxis display=none fitpolicy=none reverse;
	format id group.; *Format added;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But then the format isn’t displayed as expected:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Forest plot formatted.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17897i225EED33389C4B78/image-size/large?v=v2&amp;amp;px=999" role="button" title="Forest plot formatted.png" alt="Forest plot formatted.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone who knows what to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 22:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-yaxistable-omits-values/m-p/427860#M14735</guid>
      <dc:creator>Riis</dc:creator>
      <dc:date>2018-01-15T22:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT: yaxistable omits values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-yaxistable-omits-values/m-p/427861#M14736</link>
      <description>&lt;P&gt;I think I got around this by adding invisible characters to the No/Yes categories so they are actually different and will get grouped individually but still look the same.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 22:10:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-yaxistable-omits-values/m-p/427861#M14736</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-15T22:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT: yaxistable omits values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-yaxistable-omits-values/m-p/427994#M14746</link>
      <description>&lt;P&gt;Thanks Reeza! It works but there must be another way to get the format printed? I have many No/Yes-categories so I will have to insert many invisible characters...&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 13:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-yaxistable-omits-values/m-p/427994#M14746</guid>
      <dc:creator>Riis</dc:creator>
      <dc:date>2018-01-16T13:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT: yaxistable omits values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-yaxistable-omits-values/m-p/428093#M14749</link>
      <description>&lt;P&gt;See if this plot is closer to what you want:&lt;/P&gt;
&lt;PRE&gt;proc format;
value group
1='Age'
2='&amp;lt;60 years'
3='&amp;gt;=60 years'
4='Sex'
5='Females'
6='Males'
7='Diabetes mellitus'
8='No'
9='Yes'
10='Hypertension'
11='No'
12='Yes'
13='Active smoking'
14='No'
15='Yes';
run;

data forestplot;
input group $1-18 est low up indent plot;
format est low up 5.1;
id=_n_;
idf=_n_;
format idf group.;
datalines;
Age                 .     .     .  . 1
&amp;lt;60 years         13.2  12.8  13.7 1 1
&amp;gt;=60 years        15.5  13.2  18.1 1 1
Sex                 .     .     .  . 1
Females           13.8  13.3  14.4 1 1
Males             14.7  14.1  15.4 1 1
Diabetes mellitus   .     .     .  . 2
No                14.1  13.6  14.5 1 2
Yes               16.4  14.7  18.1 1 2
Hypertension        .     .     .  . 3
No                11.4  10.9  11.9 1 3
Yes               18.1  17.4  18.8 1 3
Active smoking      .     .     .  . 4
No                13.5  13.1  14.0 1 4
Yes               16.1  15.1  17.0 1 4
;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure if you actually want the axis table in the final result or were just using that to show a desired order.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 16:45:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-yaxistable-omits-values/m-p/428093#M14749</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-16T16:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT: yaxistable omits values</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-yaxistable-omits-values/m-p/429077#M14839</link>
      <description>&lt;P&gt;Yes, I need the table in the final plot.&lt;/P&gt;&lt;P&gt;Is there a proc sgplot missing from your reply?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2018 10:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-yaxistable-omits-values/m-p/429077#M14839</guid>
      <dc:creator>Riis</dc:creator>
      <dc:date>2018-01-19T10:50:54Z</dc:date>
    </item>
  </channel>
</rss>

