<?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 Adding reference line in p-chart in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927090#M46095</link>
    <description>&lt;P&gt;I need to add a horizontal reference line at 90% to represent my target in the p-chart. When I put &amp;nbsp;href=0.9 in my code I got the following warning&lt;/P&gt;&lt;P&gt;"WARNING: Numeric href= values are incompatible with a character subgroup variable; HREF= lines are not displayed."&lt;/P&gt;&lt;P&gt;The warning indicates that the &lt;STRONG&gt;href&lt;/STRONG&gt; value is not compatible because the subgroup variable, &lt;STRONG&gt;quarter&lt;/STRONG&gt;, is treated as a character data type.&lt;/P&gt;&lt;P&gt;How to include the target line?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;proc shewhart data=tmp2;&lt;BR /&gt;pchart yes_answer1*quarter/ markers&amp;nbsp; subgroupn = total_count1&lt;BR /&gt;nohlabel&amp;nbsp; &amp;nbsp;Href=0.9;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Sun, 05 May 2024 13:36:39 GMT</pubDate>
    <dc:creator>bhr-q</dc:creator>
    <dc:date>2024-05-05T13:36:39Z</dc:date>
    <item>
      <title>Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927090#M46095</link>
      <description>&lt;P&gt;I need to add a horizontal reference line at 90% to represent my target in the p-chart. When I put &amp;nbsp;href=0.9 in my code I got the following warning&lt;/P&gt;&lt;P&gt;"WARNING: Numeric href= values are incompatible with a character subgroup variable; HREF= lines are not displayed."&lt;/P&gt;&lt;P&gt;The warning indicates that the &lt;STRONG&gt;href&lt;/STRONG&gt; value is not compatible because the subgroup variable, &lt;STRONG&gt;quarter&lt;/STRONG&gt;, is treated as a character data type.&lt;/P&gt;&lt;P&gt;How to include the target line?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;proc shewhart data=tmp2;&lt;BR /&gt;pchart yes_answer1*quarter/ markers&amp;nbsp; subgroupn = total_count1&lt;BR /&gt;nohlabel&amp;nbsp; &amp;nbsp;Href=0.9;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 13:36:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927090#M46095</guid>
      <dc:creator>bhr-q</dc:creator>
      <dc:date>2024-05-05T13:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927092#M46097</link>
      <description>&lt;P&gt;Just turn your quarter variable into something numeric.&lt;BR /&gt;Like here :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Battery;
   length lot $6;
   input lot nFailed Sampsize @@;
   label nFailed  = 'Number Failed'
         lot      = 'Lot Number'
         Sampsize = 'Number Sampled';
   Quarter_num = yyq(scan(lot,1,'Q'),scan(lot,2,'Q'));
   datalines;
2015Q1  6  151     2015Q2  5  142     2015Q3  6  145
2015Q4  9  149     2016Q1  3  150     2016Q2  0  156
2016Q3  4  150     2016Q4  9  158     2017Q1  4  152
2017Q2  0  162     2017Q3  9  140     2017Q4  7  161
2018Q1  6  154     2018Q2  1  144     2018Q3  5  154
2018Q4  3  151     2019Q1  8  148     2019Q2  2  143
2019Q3  4  150     2019Q4  4  147     2020Q1  0  150
2020Q2  2  154     2020Q3  8  149     2020Q4  3  160
2021Q1  9  153
;

/* The variable nFailed contains the number of battery failures, */
/* the variable Lot contains the lot number,                     */
/* and the variable Sampsize contains the lot sample size.       */
/* The following statements request a p chart for this data:     */
ods graphics off;
title 'Proportion of Battery Failures';
proc shewhart data=Battery;
   pchart nFailed*Lot / subgroupn = Sampsize
                      /*turnhlabels*/ nohlabel href=20400 21200 21800
                        font      = 'Lucida Console'
                        outlimits = Batlim;
   label nFailed = 'Proportion Failed';
run;

ods graphics off;
title 'Proportion of Battery Failures';
proc shewhart data=Battery;
   pchart nFailed*Quarter_num / /*totpanels=40*/ npanelpos=2500 
                        subgroupn = Sampsize
                      /*turnhlabels*/ nohlabel href=20400 21200 21800
                        font      = 'Lucida Console'
                        outlimits = Batlim;
   label nFailed = 'Proportion Failed';
   format Quarter_num yyQ.;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 14:11:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927092#M46097</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-05-05T14:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927094#M46099</link>
      <description>&lt;DIV class="xisDoc-eDocBody"&gt;
&lt;DIV class="xisDoc-refProc"&gt;
&lt;DIV id="qcug.shewhart.shw_opt_general" class="aa-section"&gt;
&lt;DIV class="aa-options"&gt;
&lt;DL class="aa-options"&gt;
&lt;DT&gt;&lt;SPAN class=" aa-term "&gt;HREF=&lt;SPAN class=" aa-argument"&gt;values&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DT&gt;
&lt;DD&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;draws reference lines perpendicular to the horizontal (subgroup) axis on the primary chart.&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="xisDoc-eDocBody"&gt;
&lt;DIV class="xisDoc-refProc"&gt;
&lt;DIV id="qcug.shewhart.shw_opt_general" class="aa-section"&gt;
&lt;DIV class="aa-options"&gt;
&lt;DL class="aa-options"&gt;
&lt;DT&gt;&lt;SPAN class=" aa-term "&gt;VREF=&lt;SPAN class=" aa-argument"&gt;value-list&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DT&gt;
&lt;DD&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;draws reference lines perpendicular to the vertical axis on the primary chart.&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;Koen&lt;/P&gt;
&lt;/DD&gt;
&lt;/DL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DD&gt;
&lt;/DL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 05 May 2024 14:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927094#M46099</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-05-05T14:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927099#M46100</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV class="xisDoc-eDocBody"&gt;
&lt;DIV class="xisDoc-refProc"&gt;
&lt;DIV id="qcug.shewhart.shw_opt_general" class="aa-section"&gt;
&lt;DIV class="aa-options"&gt;
&lt;DL class="aa-options"&gt;
&lt;DT&gt;&lt;SPAN class=" aa-term "&gt;HREF=&lt;SPAN class=" aa-argument"&gt;values&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DT&gt;
&lt;DD&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;draws reference lines perpendicular to the horizontal (subgroup) axis on the primary chart.&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="xisDoc-eDocBody"&gt;
&lt;DIV class="xisDoc-refProc"&gt;
&lt;DIV id="qcug.shewhart.shw_opt_general" class="aa-section"&gt;
&lt;DIV class="aa-options"&gt;
&lt;DL class="aa-options"&gt;
&lt;DT&gt;&lt;SPAN class=" aa-term "&gt;VREF=&lt;SPAN class=" aa-argument"&gt;value-list&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DT&gt;
&lt;DD&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;draws reference lines perpendicular to the vertical axis on the primary chart.&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;Koen&lt;/P&gt;
&lt;/DD&gt;
&lt;/DL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DD&gt;
&lt;/DL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This always feels backwards to me.&amp;nbsp; First instinct is that HREF means "horizontal reference line."&amp;nbsp; I'm sure the developer had a good reason for doing it this way... Luckily even though I can't remember which to use, there are only two options to try.&amp;nbsp; : )&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 15:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927099#M46100</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-05-05T15:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927120#M46103</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Thank you for your answer; I ran the code below but couldn't get the ref line.&lt;BR /&gt;&lt;BR /&gt;data tmp2_numeric;
   set tmp2;
   quarter_num = yyq(scan (quarter, 1, 'Q'), scan (quarter, 2, 'Q'));
run;
proc shewhart data=tmp2_numeric;
   pchart yes_answer1*quarter_num/ subgroupn=total_count1
                                   nohlabel 
                                   href=0.9;  
 label quarter_num= 'Quarter';
 label yes_answer1 = 'Proportion of pts counselled'; 
 format quarter_num yyQ.;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 02:15:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927120#M46103</guid>
      <dc:creator>bhr-q</dc:creator>
      <dc:date>2024-05-06T02:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927139#M46110</link>
      <description>&lt;P&gt;I cannot see the LOG of your code after submission, but 2 things might have gone wrong here:&lt;/P&gt;
&lt;P&gt;1. are your quarters (the character version) strings like "2022Q2" (yyyy for the year then a letter Q and then the quarter number)?&lt;/P&gt;
&lt;P&gt;2. you need vref=0.9 instead of href=0.9.&amp;nbsp; I do not see how 0.9 can be a quarter-indication, but 0.9 can be a proportion. On the VREF= option, you specify vertical axis values, on the HREF= option you specify horizontal axis values. Like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;, you might be confused about this&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 09:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927139#M46110</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-05-06T09:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927270#M46136</link>
      <description>Thank you for your answer, I could have a target line using VREF now.&lt;BR /&gt;Just wondering when I consider:&lt;BR /&gt;Vref=0.90 CVREF=green;&lt;BR /&gt;I expected to have a green line, but the color doesn't change.</description>
      <pubDate>Tue, 07 May 2024 04:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927270#M46136</guid>
      <dc:creator>bhr-q</dc:creator>
      <dc:date>2024-05-07T04:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927296#M46138</link>
      <description>&lt;P&gt;Unfortunately, looks like cvref= and similar options only apply if you are using SAS/GRAPH to generate the output graph.&amp;nbsp; They don't apply to graphs generated with ODS graphics.&amp;nbsp; I think to get the refline to be a different color, you will have to look at modifying the ODS style template.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option I have used is to use PROC SHEWHART to calculate the process limits etc, then output that data to a dataset and use SGPLOT to make the graph.&amp;nbsp; In SGPLOT there are options to directly control the color of lines, markers, etc, without having to muck with a style template.&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 12:22:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927296#M46138</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-05-07T12:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927782#M46172</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;thank you for taking the time to mark an accepted solution, as that helps the community.&amp;nbsp; In this case, I would recommend you change the accepted solution to be&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;'s answer where they provided the answer (which I quoted in my message).&amp;nbsp; My answer wasn't really the solution, it was more a note of sympathy that I often make the same mistake.&amp;nbsp; I believe if you click somewhere on my answer, there will be a button that allows you to say "this is NOT the solution", and after saving that change, you should then be able to pick Koen's answer as the real solution.&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 21:46:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927782#M46172</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-05-09T21:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927784#M46173</link>
      <description>I agree with you, I actually tried to do that with right click on your answer but couldn't find that. if there is anyway let me know to do that.&lt;BR /&gt;&lt;BR /&gt;Thank you so much all of you for your help and sorry for the mistake.</description>
      <pubDate>Thu, 09 May 2024 21:56:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927784#M46173</guid>
      <dc:creator>bhr-q</dc:creator>
      <dc:date>2024-05-09T21:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927787#M46175</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I agree with you, I actually tried to do that with right click on your answer but couldn't find that. if there is anyway let me know to do that.&lt;BR /&gt;Thank you so much all of you for your help and sorry for the mistake.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You should not look too hard (to change solutions).&lt;/P&gt;
&lt;P&gt;For me, it's okay. It's fine as it is. Most important thing is that your original question is solved!&lt;BR /&gt;Moreover, the&amp;nbsp;addition of &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt; (on the counter-intuitive aspect) is also relevant. Many people will recognize themselves in it.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 22:04:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927787#M46175</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-05-09T22:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Adding reference line in p-chart</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927788#M46176</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465427"&gt;@bhr-q&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I agree with you, I actually tried to do that with right click on your answer but couldn't find that. if there is anyway let me know to do that.&lt;BR /&gt;&lt;BR /&gt;Thank you so much all of you for your help and sorry for the mistake.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you still see the hamburger menu (three horizontal lines)&amp;nbsp; next to the post, I think you would click that and it should be in that menu.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Quentin_0-1715292246269.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96401i0AF25307B7809C4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Quentin_0-1715292246269.png" alt="Quentin_0-1715292246269.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it's possible that the correct answer locks after a few hours, so you might not be able to change it now.&amp;nbsp; If that's the case, no worries. I'm happy to take&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;&amp;nbsp;'s points for an accepted solution. : )&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 22:06:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Adding-reference-line-in-p-chart/m-p/927788#M46176</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-05-09T22:06:09Z</dc:date>
    </item>
  </channel>
</rss>

