<?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: One-sided exact (Clopper-Pearson) interval in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/One-sided-exact-Clopper-Pearson-interval/m-p/152778#M40175</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There may be a problem with coverage in an exact interval.&amp;nbsp; In the documentation for PROC FREQ (Details:Statistical Computations:Binomial Proportions), there is a statement that the confidence interval is conservative and unless the sample size is large, the actual covarage probability can be much larger thatn the target.&amp;nbsp; So, because this becomes a discrete problem, you may be getting a wider interval than you might expect--the boundary HAS to be defined by some integer value m such that prob(m/N)&amp;gt;=alpha. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, it gives the formulas for calculating the boundaries, and you can see that for a 95% interval (two-sided), it plugs in alpha/2 = 0.025.&amp;nbsp; Thus a 90% interval two sided will give a one-sided bound because the Clopper-Pearson interval is constructed by inverting the equal-tailed test.&amp;nbsp; It's just bigger than you might expect due to the granularity of the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Dec 2013 15:51:51 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2013-12-03T15:51:51Z</dc:date>
    <item>
      <title>One-sided exact (Clopper-Pearson) interval</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/One-sided-exact-Clopper-Pearson-interval/m-p/152775#M40172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a small problem when it comes to computing one-sided clopper-pearson confidence intervals for a binomial proportion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 1007 failures (coded 0) and 1 success (coded 1) in a dataset. I want an exact one-sided upper confidence limit for the success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the code I used so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=x;&lt;/P&gt;&lt;P&gt;tables y / alpha=.01 binomial exact cl;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing complicated, but I've browsed the web for a while now and I can't find where I'm supposed to type what in order to get a one-sided interval instead of a two-sided. I managed to get a one-sided interval with some other code, but I wasn't sure that it was a Clopper-Pearson interval and therefore I could not use it. And it's really important that I obtain a Clopper-Pearson interval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for helping out,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oskar &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2013 08:32:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/One-sided-exact-Clopper-Pearson-interval/m-p/152775#M40172</guid>
      <dc:creator>oskarseriksson</dc:creator>
      <dc:date>2013-11-22T08:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: One-sided exact (Clopper-Pearson) interval</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/One-sided-exact-Clopper-Pearson-interval/m-p/152776#M40173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The value you get for the two sided, with alpha=0.01 is equal to the one-sided alpha of 0.005. (alpha=0.1 two-tailed = 0.05 one-tailed).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 16:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/One-sided-exact-Clopper-Pearson-interval/m-p/152776#M40173</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2013-11-25T16:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: One-sided exact (Clopper-Pearson) interval</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/One-sided-exact-Clopper-Pearson-interval/m-p/152777#M40174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's correct, but it doesn't quite solve my problem entirely. The main reason is that the two-sided interval with half the alpha-value returns a wider interval than necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'd very much appreciate a way to code a one-sided interval instead. And it needs to be an exact interval (i.e. Clopper-Pearson).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oskar Eriksson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2013 10:29:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/One-sided-exact-Clopper-Pearson-interval/m-p/152777#M40174</guid>
      <dc:creator>oskarseriksson</dc:creator>
      <dc:date>2013-11-27T10:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: One-sided exact (Clopper-Pearson) interval</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/One-sided-exact-Clopper-Pearson-interval/m-p/152778#M40175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There may be a problem with coverage in an exact interval.&amp;nbsp; In the documentation for PROC FREQ (Details:Statistical Computations:Binomial Proportions), there is a statement that the confidence interval is conservative and unless the sample size is large, the actual covarage probability can be much larger thatn the target.&amp;nbsp; So, because this becomes a discrete problem, you may be getting a wider interval than you might expect--the boundary HAS to be defined by some integer value m such that prob(m/N)&amp;gt;=alpha. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, it gives the formulas for calculating the boundaries, and you can see that for a 95% interval (two-sided), it plugs in alpha/2 = 0.025.&amp;nbsp; Thus a 90% interval two sided will give a one-sided bound because the Clopper-Pearson interval is constructed by inverting the equal-tailed test.&amp;nbsp; It's just bigger than you might expect due to the granularity of the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 15:51:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/One-sided-exact-Clopper-Pearson-interval/m-p/152778#M40175</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2013-12-03T15:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: One-sided exact (Clopper-Pearson) interval</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/One-sided-exact-Clopper-Pearson-interval/m-p/152779#M40176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I feel a bit stupid! How did I not consider the option to go for a wider two-sided?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the coverage probability exceeding 1-alpha, that is sort of important for this particular inference given the sensitive context the results will be used in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for walking me around the obstacle! Maybe someday there'll be a possibility to code a one-sided more easily.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My gratitude,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oskar Eriksson &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 07:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/One-sided-exact-Clopper-Pearson-interval/m-p/152779#M40176</guid>
      <dc:creator>oskarseriksson</dc:creator>
      <dc:date>2013-12-04T07:37:35Z</dc:date>
    </item>
  </channel>
</rss>

