<?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 add reference lines per category in proc sgplot ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/433055#M107328</link>
    <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;The reflines depend on the subpop (=subpopulations)&amp;nbsp;I will probably have to define them by subpop?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;refline 10 and 50 apply to subpop's a, b, c and d&lt;/P&gt;&lt;P&gt;refline 15 and 50 apply to subpop's e, f and g&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2018 09:48:04 GMT</pubDate>
    <dc:creator>IsabelleM</dc:creator>
    <dc:date>2018-02-01T09:48:04Z</dc:date>
    <item>
      <title>How to add reference lines per category in proc sgplot ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/431278#M106646</link>
      <description>&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;My dataset contains vitamin D intake from 4 different sources (bron) for 7 different subpopulations (a,b,c,d,e,f,g).&lt;/P&gt;&lt;P&gt;Is it possible to create reference lines that do not cover the entire width of a graph but with a limited to the concerned category.&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="SGPlot2.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18119i4B33A30F5F825F6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot2.png" alt="SGPlot2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format; 
value formsubpop  1="a"
                  2="b"
			      3="c"
			      4="d"
			      5="e"
			      6="f"
			      7="g";
			      run;

proc sort data=VitD_aggr;
by subpop ;
run;

proc sgplot data=VitD_aggr;
  vbox VitD_tot/category=subpop group=bron grouporder=descending boxwidth=0.9 NOOUTLIERS;
    YAXIS LABEL = 'Usual vitamin D intake (ug/day)' GRID VALUES = (0 TO 50 BY 10); 
  xaxis display=(nolabel) ;
  REFLINE 10 /label="AI=10 ug/day" lineattrs=(color=green);
  REFLINE 25 /label="UL=25 ug/day" lineattrs=(color=red);
  REFLINE 15 /label="AI=15 ug/day" lineattrs=(color=green);
  REFLINE 50 / label="UL=50 ug/day" lineattrs=(color=red);
  format subpop formsubpop. ;
  keylegend / location =outside position =bottom across=1;
  run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 14:29:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/431278#M106646</guid>
      <dc:creator>IsabelleM</dc:creator>
      <dc:date>2018-01-26T14:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines per category in proc sgplot ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/431280#M106647</link>
      <description>&lt;P&gt;How do you know if a refline applies to a certain category? If it is in the 95% confidence interval? If it is in the quartile range?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 14:35:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/431280#M106647</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-01-26T14:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines per category in proc sgplot ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/431316#M106669</link>
      <description>&lt;P&gt;It sounds like you are asking for something that likely is in the annotate facility. That will allow you do specify drawing a line between two coordinates over/under other elements. You would construct an appropriate data set with the drawing instructions and reference in the procedure with the SGANNO= option to indicate the set to use. There are a number of macros available to help such as %sgline to create the instructions given some parameters such as coordinates and line properties.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 15:58:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/431316#M106669</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-01-26T15:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines per category in proc sgplot ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/431318#M106670</link>
      <description>&lt;P&gt;Instead of a reference line think of it is as a customized scatter plot, with the symbols being a straight line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add in the values for your individual reference to your data set, if it's not already included.&lt;/P&gt;
&lt;P&gt;Then you can use SCATTER to include customized reference line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/188515"&gt;@IsabelleM&lt;/a&gt; wrote:&lt;BR /&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;My dataset contains vitamin D intake from 4 different sources (bron) for 7 different subpopulations (a,b,c,d,e,f,g).&lt;/P&gt;
&lt;P&gt;Is it possible to create reference lines that do not cover the entire width of a graph but with a limited to the concerned category.&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="SGPlot2.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18119i4B33A30F5F825F6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot2.png" alt="SGPlot2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format; 
value formsubpop  1="a"
                  2="b"
			      3="c"
			      4="d"
			      5="e"
			      6="f"
			      7="g";
			      run;

proc sort data=VitD_aggr;
by subpop ;
run;

proc sgplot data=VitD_aggr;
  vbox VitD_tot/category=subpop group=bron grouporder=descending boxwidth=0.9 NOOUTLIERS;
    YAXIS LABEL = 'Usual vitamin D intake (ug/day)' GRID VALUES = (0 TO 50 BY 10); 
  xaxis display=(nolabel) ;
  REFLINE 10 /label="AI=10 ug/day" lineattrs=(color=green);
  REFLINE 25 /label="UL=25 ug/day" lineattrs=(color=red);
  REFLINE 15 /label="AI=15 ug/day" lineattrs=(color=green);
  REFLINE 50 / label="UL=50 ug/day" lineattrs=(color=red);
  format subpop formsubpop. ;
  keylegend / location =outside position =bottom across=1;
  run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 16:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/431318#M106670</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-26T16:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines per category in proc sgplot ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/433055#M107328</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;The reflines depend on the subpop (=subpopulations)&amp;nbsp;I will probably have to define them by subpop?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;refline 10 and 50 apply to subpop's a, b, c and d&lt;/P&gt;&lt;P&gt;refline 15 and 50 apply to subpop's e, f and g&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 09:48:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/433055#M107328</guid>
      <dc:creator>IsabelleM</dc:creator>
      <dc:date>2018-02-01T09:48:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to add reference lines per category in proc sgplot ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/433085#M107340</link>
      <description>&lt;P&gt;I have tried this out with polylines and polycont and it worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 12:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-reference-lines-per-category-in-proc-sgplot/m-p/433085#M107340</guid>
      <dc:creator>IsabelleM</dc:creator>
      <dc:date>2018-02-01T12:42:56Z</dc:date>
    </item>
  </channel>
</rss>

