<?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: Proc SEQDESIGN Understanding the NULLREF and ALTREF in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-SEQDESIGN-Understanding-the-NULLREF-and-ALTREF/m-p/487830#M25307</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5996"&gt;@JulieB&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not really familiar with PROC SEQDESIGN, but I have some acquaintance with the subject from an earlier job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A short answer to your question can be found in subsection "Test for a Binomial Proportion" of section "&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_seqdesign_details49.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank"&gt;Applicable One-Sample Tests and Sample Size Computation&lt;/A&gt;" of the PROC SEQDESIGN documentation. There you can see that the procedure computes&amp;nbsp;the&amp;nbsp;total sample size as an expression proportional to p(1−p). However, as the true value of parameter p is unknown, it must be substituted in the sample size formula by a reasonable value. Via procedure options, either of the two "obvious candidates" can be chosen: p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;=0.1 from the null hypothesis&amp;nbsp;or p&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;=0.3 from the specified alternative. (The &lt;EM&gt;alternative hypothesis&lt;/EM&gt; of the test is p&amp;gt;0.1.) That's why the sample size using the alternative reference is about 2.3 times larger than the other (0.3*(1&lt;SPAN&gt;−&lt;/SPAN&gt;0.3)/(0.1*(1&lt;SPAN&gt;−0.1))=2.333...).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The documentation (see link above) argues that "in most cases, the proportion under the alternative hypothesis is used to derive the required sample size" because typically the null hypothesis will be rejected in the end. So, having used p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt; for the sample size calculation would seem inconsistent in retrospect. Therefore, REF=PROP had been made the default, not REF=NULLPROP.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The formulas in the above linked documentation use normal approximations, assuming a "large sample" and a p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt; "not close to 0 or 1". (And it seems that this is the reason why the variance term containing p(1−p) comes into play.) I'm not convinced that your envisioned sample sizes and p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;=0.1&amp;nbsp;clearly meet these assumptions. At least they don't satisfy the "np&amp;gt;=5, n(1−p)&amp;gt;=5" rule of thumb mentioned in standard textbooks and &lt;A href="https://en.wikipedia.org/wiki/Binomial_distribution#Normal_approximation" target="_blank"&gt;Wikipedia&lt;/A&gt;. But there seems to be a good alternative method: In their book "&lt;A href="https://www.crcpress.com/Group-Sequential-Methods-with-Applications-to-Clinical-Trials/Jennison-Turnbull/p/book/9780849303166" target="_blank"&gt;Group Sequential Methods with Applications to Clinical Trials&lt;/A&gt;" (which is frequently referred to in the PROC SEQDESIGN documentation), C. Jennison and B.W. Turnbull discuss the above-mentioned difficulties and suggest using&amp;nbsp;&lt;EM&gt;exact&lt;/EM&gt; methods (chapter 12, p. 235).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;One of the two-stage procedures&amp;nbsp;they present in table 12.1 (p. 238), which originates from a 1982 article by T.R. Fleming, happens to match your requirements (one-sample binomial test of p=p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt; vs. p&amp;gt;p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&amp;nbsp;with p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;=0.1, p&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;=0.3, approximate type I error rate 0.05 and approx. power 0.9). If you don't have this book at hand, you can see the relevant page using the "Look inside" feature of a well-known online book seller :-). There you can find the relevant (inclusive) boundaries for acceptance (a&lt;FONT size="1 2 3 4 5 6 7"&gt;i&lt;/FONT&gt;) and rejection (b&lt;FONT size="1 2 3 4 5 6 7"&gt;i&lt;/FONT&gt;) and the sample sizes (m&lt;FONT size="1 2 3 4 5 6 7"&gt;i&lt;/FONT&gt;), i=1, 2. As it turns out, the total sample size m&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;+m&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt; for this procedure is about halfway between the two sample sizes you've calculated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Moreover, it's easy to verify the actual type I and type II error rates stated in the book:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
alpha=1-cdf('binom',5,0.1,20)+pdf('binom',3,0.1,20)*(1-cdf('binom',3,0.1,15))
                             +pdf('binom',4,0.1,20)*(1-cdf('binom',2,0.1,15))
                             +pdf('binom',5,0.1,20)*(1-cdf('binom',1,0.1,15));
beta=cdf('binom',2,0.3,20)+pdf('binom',3,0.3,20)*cdf('binom',3,0.3,15)
                          +pdf('binom',4,0.3,20)*cdf('binom',2,0.3,15)
                          +pdf('binom',5,0.3,20)*cdf('binom',1,0.3,15);
put (_all_)(=/);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this helps.&lt;/SPAN&gt;&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;
&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Aug 2018 16:03:03 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-08-17T16:03:03Z</dc:date>
    <item>
      <title>Proc SEQDESIGN Understanding the NULLREF and ALTREF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-SEQDESIGN-Understanding-the-NULLREF-and-ALTREF/m-p/487568#M25291</link>
      <description>&lt;P&gt;I am trying to use proc seqdesign to calculate a sample size for a one sample binomial proportion.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My problem is that&amp;nbsp;I am having trouble understanding why specifying&amp;nbsp;ref=nullprop gives such a different result than when I do not specify this option.&amp;nbsp; Can you help me understand what it means when the reference proportion is the alt ref?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the following code it recommends N=21 for this scenario:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on;
proc seqdesign 
boundaryscale=stdz;
   OneSidedOBrienFleming: design method=obf
                       nstages=2
                       alt=upper
		       alpha=0.05
                       beta=0.10
		       stop=both
		       (betaboundary=nonbinding)
                       ;
   samplesize model=onesamplefreq( nullprop=0.10 prop=0.30 ref=nullprop);
ods output Boundary=Bnd_Prop;
run;
ods graphics off;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However if I use this code, which I thought based on the help documentation should be equivalent, it recommends N=48.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on;
proc seqdesign altref=0.20
               boundaryscale=stdz;
   OneSidedOBrienFleming: design method=obf
                       nstages=2
                       alt=upper
		       alpha=0.05
                       beta=0.10
		       stop=both
		      (betaboundary=nonbinding)
                       ;
samplesize model=onesamplefreq( nullprop=0.10);
ods output Boundary=Bnd_Prop;
run;
ods graphics off;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To me it seems like both situations should be testing the null proportion of 0.10 against the alternative of 0.30.&amp;nbsp; Can you help me understand the difference between the two?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;JB&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 19:39:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-SEQDESIGN-Understanding-the-NULLREF-and-ALTREF/m-p/487568#M25291</guid>
      <dc:creator>JulieB</dc:creator>
      <dc:date>2018-08-16T19:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SEQDESIGN Understanding the NULLREF and ALTREF</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-SEQDESIGN-Understanding-the-NULLREF-and-ALTREF/m-p/487830#M25307</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5996"&gt;@JulieB&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not really familiar with PROC SEQDESIGN, but I have some acquaintance with the subject from an earlier job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A short answer to your question can be found in subsection "Test for a Binomial Proportion" of section "&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_seqdesign_details49.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank"&gt;Applicable One-Sample Tests and Sample Size Computation&lt;/A&gt;" of the PROC SEQDESIGN documentation. There you can see that the procedure computes&amp;nbsp;the&amp;nbsp;total sample size as an expression proportional to p(1−p). However, as the true value of parameter p is unknown, it must be substituted in the sample size formula by a reasonable value. Via procedure options, either of the two "obvious candidates" can be chosen: p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;=0.1 from the null hypothesis&amp;nbsp;or p&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;=0.3 from the specified alternative. (The &lt;EM&gt;alternative hypothesis&lt;/EM&gt; of the test is p&amp;gt;0.1.) That's why the sample size using the alternative reference is about 2.3 times larger than the other (0.3*(1&lt;SPAN&gt;−&lt;/SPAN&gt;0.3)/(0.1*(1&lt;SPAN&gt;−0.1))=2.333...).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The documentation (see link above) argues that "in most cases, the proportion under the alternative hypothesis is used to derive the required sample size" because typically the null hypothesis will be rejected in the end. So, having used p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt; for the sample size calculation would seem inconsistent in retrospect. Therefore, REF=PROP had been made the default, not REF=NULLPROP.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The formulas in the above linked documentation use normal approximations, assuming a "large sample" and a p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt; "not close to 0 or 1". (And it seems that this is the reason why the variance term containing p(1−p) comes into play.) I'm not convinced that your envisioned sample sizes and p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;=0.1&amp;nbsp;clearly meet these assumptions. At least they don't satisfy the "np&amp;gt;=5, n(1−p)&amp;gt;=5" rule of thumb mentioned in standard textbooks and &lt;A href="https://en.wikipedia.org/wiki/Binomial_distribution#Normal_approximation" target="_blank"&gt;Wikipedia&lt;/A&gt;. But there seems to be a good alternative method: In their book "&lt;A href="https://www.crcpress.com/Group-Sequential-Methods-with-Applications-to-Clinical-Trials/Jennison-Turnbull/p/book/9780849303166" target="_blank"&gt;Group Sequential Methods with Applications to Clinical Trials&lt;/A&gt;" (which is frequently referred to in the PROC SEQDESIGN documentation), C. Jennison and B.W. Turnbull discuss the above-mentioned difficulties and suggest using&amp;nbsp;&lt;EM&gt;exact&lt;/EM&gt; methods (chapter 12, p. 235).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;One of the two-stage procedures&amp;nbsp;they present in table 12.1 (p. 238), which originates from a 1982 article by T.R. Fleming, happens to match your requirements (one-sample binomial test of p=p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt; vs. p&amp;gt;p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&amp;nbsp;with p&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;=0.1, p&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;=0.3, approximate type I error rate 0.05 and approx. power 0.9). If you don't have this book at hand, you can see the relevant page using the "Look inside" feature of a well-known online book seller :-). There you can find the relevant (inclusive) boundaries for acceptance (a&lt;FONT size="1 2 3 4 5 6 7"&gt;i&lt;/FONT&gt;) and rejection (b&lt;FONT size="1 2 3 4 5 6 7"&gt;i&lt;/FONT&gt;) and the sample sizes (m&lt;FONT size="1 2 3 4 5 6 7"&gt;i&lt;/FONT&gt;), i=1, 2. As it turns out, the total sample size m&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;+m&lt;FONT size="1 2 3 4 5 6 7"&gt;2&lt;/FONT&gt; for this procedure is about halfway between the two sample sizes you've calculated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Moreover, it's easy to verify the actual type I and type II error rates stated in the book:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
alpha=1-cdf('binom',5,0.1,20)+pdf('binom',3,0.1,20)*(1-cdf('binom',3,0.1,15))
                             +pdf('binom',4,0.1,20)*(1-cdf('binom',2,0.1,15))
                             +pdf('binom',5,0.1,20)*(1-cdf('binom',1,0.1,15));
beta=cdf('binom',2,0.3,20)+pdf('binom',3,0.3,20)*cdf('binom',3,0.3,15)
                          +pdf('binom',4,0.3,20)*cdf('binom',2,0.3,15)
                          +pdf('binom',5,0.3,20)*cdf('binom',1,0.3,15);
put (_all_)(=/);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I hope this helps.&lt;/SPAN&gt;&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;
&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2018 16:03:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-SEQDESIGN-Understanding-the-NULLREF-and-ALTREF/m-p/487830#M25307</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-08-17T16:03:03Z</dc:date>
    </item>
  </channel>
</rss>

