<?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: Negative Confidence Interval using PROC means in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566911#M159385</link>
    <description>&lt;P&gt;I consider the negative lower confidence interval as a problem as the variable which is a default rate, can not be in negative. The goal is to see how the minimum and maximum values are for a default % for a specific population.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I know how can I check if my data is log-normally distributed. (Indeed, I am going to check myself as well)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jun 2019 14:53:00 GMT</pubDate>
    <dc:creator>ggfggrr</dc:creator>
    <dc:date>2019-06-18T14:53:00Z</dc:date>
    <item>
      <title>Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566881#M159381</link>
      <description>&lt;P&gt;I have calculated the confidence intervals using the reference &lt;A href="https://www.lexjansen.com/pharmasug/2003/Posters/P048.pdf" target="_blank" rel="noopener"&gt;https://www.lexjansen.com/pharmasug/2003/Posters/P048.pdf&lt;/A&gt;&amp;nbsp;and implemented the following code for my dataset;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC MEANS DATA=data NOPRINT ;
by model reason;
VAR default;
OUTPUT OUT=xxtmp N=n MEAN=mean
STDERR=stderr LCLM=lclm Uclm=uclm ;
RUN ;

DATA xxtmp15 ;
SET xxtmp ;
lo = mean - ( TINV ( 0.9 , n-1 ) * stderr ) ;
hi = mean + ( TINV ( 0.9 , n-1 ) * stderr ) ;
RUN ;&lt;/PRE&gt;&lt;P&gt;However, as a result of it, I receive a lower limit of the confidence interval as negative.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that I should use the log-normal distribution for avoiding the negative lower limit for confidence intervals. However, I don't exactly know how I can give this input to PROC MEANS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help on this is highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Mari&lt;/P&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;</description>
      <pubDate>Tue, 18 Jun 2019 14:16:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566881#M159381</guid>
      <dc:creator>ggfggrr</dc:creator>
      <dc:date>2019-06-18T14:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566898#M159382</link>
      <description>&lt;P&gt;Negative values in a confidence interval are not impossible, so explain further why this is a problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, why do you compute the confidence intervals via a data step when they are computed by PROC MEANS and stored using the UCLM and LCLM option?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 14:29:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566898#M159382</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-18T14:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566901#M159383</link>
      <description>&lt;P&gt;The reason, I believe may be due to the small sample size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the very same results with or without using data step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I read literature that this needs to be done using log-normal distribution and don't find the ways to input this need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 14:38:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566901#M159383</guid>
      <dc:creator>ggfggrr</dc:creator>
      <dc:date>2019-06-18T14:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566908#M159384</link>
      <description>&lt;P&gt;So, you still have not explained why you consider negative confidence intervals a problem that needs to be fixed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You use Lognormal distribution confidence intervals only if your data has a lognormal distribution.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 14:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566908#M159384</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-18T14:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566911#M159385</link>
      <description>&lt;P&gt;I consider the negative lower confidence interval as a problem as the variable which is a default rate, can not be in negative. The goal is to see how the minimum and maximum values are for a default % for a specific population.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I know how can I check if my data is log-normally distributed. (Indeed, I am going to check myself as well)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 14:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566911#M159385</guid>
      <dc:creator>ggfggrr</dc:creator>
      <dc:date>2019-06-18T14:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566912#M159386</link>
      <description>&lt;P&gt;Lognormal and normal are not appropriate for Rates, which I assume are a percent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might be able to make use of binomial distribution confidence intervals, again depending on the distribution of your data. What is the distribution of your data?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 14:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566912#M159386</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-18T14:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566936#M159391</link>
      <description>&lt;P&gt;I think I am understanding better with your comments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my case, i calculated the default % for a population (using the fact that whether a client has defaulted or not. 1 if yes, 0 if not). Then Ideally I am looking into the binomial distribution.&amp;nbsp; I found this code helping;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=data
by model reason;
tables default/ nocum norow binomial;
output out=results;
exact binomial;
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is the above you think is right to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And in case if this is calculated for the non-defaults (0), exploring to know how can I inform SAS to estimate the confidence interval limits for the defaults (1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Mari&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 16:22:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566936#M159391</guid>
      <dc:creator>ggfggrr</dc:creator>
      <dc:date>2019-06-18T16:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566968#M159405</link>
      <description>&lt;P&gt;Yes, binomial distribution and your code is appropriate here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the confidence interval for the non-defaults is (made up example) 6% to 19%, then the confidence interval for the defaults is that confidence interval subtracted from 100% (or 81% to 94%).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you can't get negative confidence intervals using the binomial distribution.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 16:59:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566968#M159405</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-18T16:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566971#M159407</link>
      <description>&lt;P&gt;In PROC FREQ, you can use the BINOMIAL&amp;nbsp;&lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_freq_syntax08.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en#statug.freq.freqblevel" target="_self"&gt;LEVEL=&lt;/A&gt; option to specify the variable level for the binomial proportion. For example,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;tables default / binomial(level='1');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can use the BINOMIAL&amp;nbsp;&lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_freq_syntax08.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en#statug.freq.freqbcl" target="_self"&gt;CL=&lt;/A&gt;&amp;nbsp;option to specify the type(s) of binomial confidence limits to compute. Please see the doc for more info.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's true that some asymptotic methods might produce an out-of-range confidence limit (e.g., negative) for particular data. PROC FREQ truncates the binomial confidence limits at 0 and 1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 17:15:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566971#M159407</guid>
      <dc:creator>Watts</dc:creator>
      <dc:date>2019-06-18T17:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566973#M159408</link>
      <description>&lt;P&gt;Thank you so much for your help and triggering comments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 17:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566973#M159408</guid>
      <dc:creator>ggfggrr</dc:creator>
      <dc:date>2019-06-18T17:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566975#M159409</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/216488"&gt;@ggfggrr&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=data
by model reason;
tables default/ nocum norow binomial;
output out=results;
exact binomial;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is the above you think is right to do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And in case if this is calculated for the non-defaults (0), exploring to know how can I inform SAS to estimate the confidence interval limits for the defaults (1).&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just to add to the good advice you've already received:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;As an alternative to computing the "100%−x%" differences you can use the LEVEL= suboption of the BINOMIAL option of the TABLES statement (see &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_freq_syntax08.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.freq.freqblevel" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;) -- EDIT: I hadn't seen &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/270201"&gt;@Watts&lt;/a&gt;'s post, sorry:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;tables default / nocum binomial(level='1');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;The NOROW option is redundant here (as no crosstabulation is produced).&lt;/LI&gt;
&lt;LI&gt;You should add the BINOMIAL keyword to the OUTPUT statement in order to obtain the desired results in the output dataset:
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;output out=results binomial;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;The EXACT BINOMIAL statement is not needed for the exact confidence interval, but requests an exact &lt;EM&gt;test&lt;/EM&gt; (in your case: of the default null hypothesis P=0.5). Do you really want this?&lt;/LI&gt;
&lt;LI&gt;I assume the missing semicolon after your PROC FREQ statement is only a typo.&lt;/LI&gt;
&lt;LI&gt;If you have downloaded the PDF file from the URL in your first post, you may want to change the file name to something like P048_FAULTY!.pdf or delete it.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 18 Jun 2019 17:22:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/566975#M159409</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-06-18T17:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Negative Confidence Interval using PROC means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/567184#M159469</link>
      <description>&lt;P&gt;Thanks so much and it helps me a lot in knowing these options.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;&lt;P&gt;Mari&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 09:15:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Negative-Confidence-Interval-using-PROC-means/m-p/567184#M159469</guid>
      <dc:creator>ggfggrr</dc:creator>
      <dc:date>2019-06-19T09:15:50Z</dc:date>
    </item>
  </channel>
</rss>

