<?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: min, max function with 95ci in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925561#M26569</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Whatever that first picture might be is unreadable as the text is too small.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;If you click on the picture it shows in a readable size.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1713929380798.png" style="width: 1006px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95798i70DDA044E9BCD124/image-dimensions/1006x171?v=v2" width="1006" height="171" role="button" title="Patrick_0-1713929380798.png" alt="Patrick_0-1713929380798.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not on my system. The picture got very slightly larger but not enough to read.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2024 13:33:12 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-04-24T13:33:12Z</dc:date>
    <item>
      <title>min, max function with 95ci</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925313#M26565</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I received programming notes to update my code using "min" , "max"&amp;nbsp; function.&amp;nbsp; Here is the request :&lt;/P&gt;&lt;DIV class=""&gt;&lt;BR /&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HitmonTran_0-1713840881064.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95763i147DE665422F7C9D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HitmonTran_0-1713840881064.png" alt="HitmonTran_0-1713840881064.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my code (not sure if i did it correctly, because I have 95CI% greater than 100%)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;        
data tbl;
set tbl;
array xcol_ {3} col1-col3;
array xn_ {3} xn1-xn3;
array xcount_ {3} xcount1-xcount3;
array xp_   {3} xp1-xp3;
array xlci_ {3} xlci1-xlci3;
array xuci_ {3} xuci1-xuci3;
retain xn1-xn3 xcount1-xcount3 0;

if anbr=4 and row_text='N' then delete;
else if anbr=4 then do;
   if row_text='n' and row_type='N' then do;
      do j=1 to 3;
         xn_{j} = xcol_{j};
      end;
   end;
   if row_text='Success' and row_type='COUNT' then do;
      do j=1 to 3;
         xcount_{j} = xcol_{j};
      end;
   end;
   if compress(row_text)='(95%CI)' then do;  /* calcualte binomial CI to replace CP CI */
  	indent=1;
       row_text='Two-Sided 95% Confidence Interval for Percentage (Normal Approximation to Binomial)';
       xz=quantile('NORMAL', 0.975);
       do j=1 to 3;
	      xp_{j} = xcount_{j} / xn_{j};
	      
	      &lt;STRONG&gt;xlci_{j}=max(xp_{j} - xz*sqrt(xp_{j}*(1-xp_{j})/xn_{j}),0)*100;
		  xuci_{j}=min(xp_{j} + xz*sqrt(xp_{j}*(1-xp_{j})/xn_{j}),100)*100;&lt;/STRONG&gt;
		  

		  xcol_{j}='('||compress(put(xlci_{j},8.2))||'%,'||compress(put(xuci_{j},8.2))||'%)';
	   end;
   end;
end;
  
run;  &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 02:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925313#M26565</guid>
      <dc:creator>HitmonTran</dc:creator>
      <dc:date>2024-04-23T02:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: min, max function with 95ci</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925355#M26566</link>
      <description>&lt;P&gt;Can you post example input data (as a DATA step with the CARDS statement)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't go through the code, but if the problem is you are getting upper confidence limit of 10000%, then I think the problem may be this line:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;xuci_{j}=min(xp_{j} + xz*sqrt(xp_{j}*(1-xp_{j})/xn_{j}),100)*100;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Should be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;xuci_{j}=min(xp_{j} + xz*sqrt(xp_{j}*(1-xp_{j})/xn_{j}),1)*100;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your value xp_{j} is a proportion (with range 0-1), not a percentage (with range 0-100).&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 12:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925355#M26566</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-04-23T12:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: min, max function with 95ci</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925370#M26567</link>
      <description>&lt;P&gt;Whatever that first picture might be is unreadable as the text is too small.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 13:31:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925370#M26567</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-23T13:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: min, max function with 95ci</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925491#M26568</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Whatever that first picture might be is unreadable as the text is too small.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;If you click on the picture it shows in a readable size.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1713929380798.png" style="width: 1006px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95798i70DDA044E9BCD124/image-dimensions/1006x171?v=v2" width="1006" height="171" role="button" title="Patrick_0-1713929380798.png" alt="Patrick_0-1713929380798.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 03:29:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925491#M26568</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-04-24T03:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: min, max function with 95ci</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925561#M26569</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Whatever that first picture might be is unreadable as the text is too small.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;If you click on the picture it shows in a readable size.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1713929380798.png" style="width: 1006px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/95798i70DDA044E9BCD124/image-dimensions/1006x171?v=v2" width="1006" height="171" role="button" title="Patrick_0-1713929380798.png" alt="Patrick_0-1713929380798.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not on my system. The picture got very slightly larger but not enough to read.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 13:33:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925561#M26569</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-24T13:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: min, max function with 95ci</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925611#M26570</link>
      <description>&lt;P&gt;Respectfully, you do not need to write your own formula for the confidence interval. PROC FREQ can produce many different CIs for the binomial proportion. The one you are using is called the "Wald" confidence interval and is the default CI when you specify the BINOMIAL option in the TABLES statement.&amp;nbsp; PROC FREQ automatically handles capping the CI so that it does not include proportions less than 0 or greater than 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For an example, see the article, &lt;A href="https://blogs.sas.com/content/iml/2019/10/21/binomial-proportions-sas.html" target="_self"&gt;"Compute and visualize binomial proportions in SAS."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 17:14:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/min-max-function-with-95ci/m-p/925611#M26570</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-04-24T17:14:42Z</dc:date>
    </item>
  </channel>
</rss>

