<?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: sample size calculation in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/sample-size-calculation/m-p/491672#M25518</link>
    <description>&lt;P&gt;You say that you could not come up with 275. What code were attempting to use and what result did you get?&lt;/P&gt;
&lt;P&gt;What statistical test(s) were to be used? One sample, two sample? Freq or means tested?&lt;/P&gt;</description>
    <pubDate>Fri, 31 Aug 2018 15:37:13 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-08-31T15:37:13Z</dc:date>
    <item>
      <title>sample size calculation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sample-size-calculation/m-p/491629#M25517</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am learning to calculate the sample size. The following paragraph is from the attached article. I am not able to come up with number &lt;STRONG&gt;275.&lt;/STRONG&gt; Please let me know The sas code Proc power which was used to calculate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sample size calculation for the trial assumed that all patients randomized to the surgical group would undergo appendectomy.&lt;BR /&gt;For computational reasons, the success rate for surgery was assumed to be 99%. Prior similar studies found&lt;BR /&gt;success rates for antibiotic treatment of approximately70%to 80%.Thus,we anticipated a 75%success rate in the antibiotic&lt;BR /&gt;therapy group and a 24%(95%CI, 75%-99%) noninferiority margin was used for the sample size calculations. We estimated that 275 patients per group would yield a power of 0.90 (1-β) to establish whether antibiotic treatment was noninferior to appendectomy using a 1-sided significance α level of .05 with Proc Power version 9.2 (SAS Institute Inc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 13:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sample-size-calculation/m-p/491629#M25517</guid>
      <dc:creator>Kyra</dc:creator>
      <dc:date>2018-08-31T13:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: sample size calculation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sample-size-calculation/m-p/491672#M25518</link>
      <description>&lt;P&gt;You say that you could not come up with 275. What code were attempting to use and what result did you get?&lt;/P&gt;
&lt;P&gt;What statistical test(s) were to be used? One sample, two sample? Freq or means tested?&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sample-size-calculation/m-p/491672#M25518</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-31T15:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: sample size calculation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sample-size-calculation/m-p/491679#M25520</link>
      <description>&lt;P&gt;I have to compare 2 proportions. It is two sample , noninferoirity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc power;&lt;BR /&gt;twosamplefreq test=fm&lt;BR /&gt;groupproportions = ( 0.75 0.99)&lt;BR /&gt;nullproportiondiff = -0.24&lt;BR /&gt;alpha = 0.05&lt;BR /&gt;sides = U&lt;BR /&gt;power = 0.9&lt;BR /&gt;ntotal = .;&lt;BR /&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(With above code i get 20)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc power;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; twosamplefreq test=fm&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; groupproportions&amp;nbsp;&amp;nbsp; = ( 0.99&amp;nbsp; 0.75)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nullproportiondiff = -0.24&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alpha&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0.05&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sides&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = U&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; power&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0.9&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ntotal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = .;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;( with above i get invalid.)&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prerna&lt;/P&gt;</description>
      <pubDate>Fri, 31 Aug 2018 15:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sample-size-calculation/m-p/491679#M25520</guid>
      <dc:creator>Kyra</dc:creator>
      <dc:date>2018-08-31T15:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: sample size calculation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sample-size-calculation/m-p/491924#M25532</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/186157"&gt;@Kyra&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for posting this interesting question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's about noninferiority testing of proportions in two independent groups, so let's recap the hypotheses:&lt;/P&gt;
&lt;PRE&gt;H0: p2−p1 &amp;lt;= −m
H1: p2−p1 &amp;gt;&amp;nbsp; −m&lt;/PRE&gt;
&lt;P&gt;where, in the example of the article, p1 and p2 are the success probabilities of surgery and antibiotic therapy, respectively, and m=0.24 is the noninferiority margin.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?  docsetId=statug&amp;amp;docsetTarget=statug_power_syntax83.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank"&gt;PROC POWER documentation&lt;/A&gt; recommends using TEST=FM in this case. Good. However, in your first PROC POWER step you reversed the order of p1 and p2 in the GROUPPROPORTIONS option. That's why your result N=20 is way too small.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the second step you corrected that, but you specified an invalid alternative: 0.75. Remember that power and sample size are always calculated for &lt;EM&gt;specific&lt;/EM&gt; parameter values from the &lt;EM&gt;alternative hypothesis&lt;/EM&gt; (H1). But the pair p1=0.99, p2=0.75 does not satisfy the inequality for H1 (see above). In fact it's on the edge of H0. Since p1 is more or less fixed, we have to choose a value p2 such that p2−0.99&amp;gt;−0.24, i.e. p2&amp;gt;0.75.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What value did the authors of the paper use? Strangely enough I couldn't find this important information in the paper. They wrote "we anticipated a 75% success rate in the antibiotic therapy group" (p. 2342), but 0.75 would be invalid, as explained above. Maybe it's a typo. Luckily, there is another article about this clinical trial freely available on the web:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3585698/" target="_blank"&gt;https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3585698/&lt;/A&gt; from the journal "BMC surgery". I found it via &lt;A href="https://clinicaltrials.gov/ct2/show/results/NCT01022567?term=NCT01022567&amp;amp;rank=1&amp;amp;sect=X70156" target="_blank"&gt;clinicaltrials.gov&lt;/A&gt;&amp;nbsp;(see section "Other Publications") using the ID mentioned in the first paper.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There it says: "we assumed ... 80% success rate for the antibiotic therapy" (p. 5). This makes much more sense!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc power;
twosamplefreq test=fm
groupproportions = (0.99 0.8)
nullproportiondiff = -0.24
alpha = 0.05
sides = U
power = 0.9
ntotal = .;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The result (with SAS 9.4 TS1M2, SAS/STAT 13.2) is &lt;STRONG&gt;N=1258, i.e. 629 per group&lt;/STRONG&gt; -- a lot more than 275.&amp;nbsp;We can compare this to the results for other values of p2 by modifying the GROUPPROPORTIONS option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;groupproportions = 0.99 | 0.76 to 0.90 by 0.01&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;              Computed N Total

                           Actual         N
   Index    Proportion2     Power     Total

       1           0.76     0.900     33360
       2           0.77     0.900      8224
       3           0.78     0.900      3604
       4           0.79     0.900      1996
       5           0.80     0.900      1258
       6           0.81     0.901       860
       7           0.82     0.900       620
       8           0.83     0.900       466
       9           0.84     0.901       362
      10           0.85     0.902       288
      11           0.86     0.901       232
      12           0.87     0.903       192
      13           0.88     0.900       158
      14           0.89     0.903       134
      15           0.90     0.905       114&lt;/PRE&gt;
&lt;P&gt;The large N values for p1−p2 close to the margin are typical as small differences are hard to detect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, where does the discrepancy come from?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all, the authors used SAS 9.&lt;STRONG&gt;2&lt;/STRONG&gt; (p. 2342), where the option TEST=FM was not available (see footnote in &lt;A href="http://support.sas.com/kb/48/616.html" target="_blank"&gt;SAS Usage Note 48616&lt;/A&gt;&amp;nbsp; or the &lt;A href="http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_power_sect012.htm" target="_blank"&gt;old documentation&lt;/A&gt;).&amp;nbsp;They could have used TEST=PCHI (the default). However, this yields N=1234 (with SAS 9.4). To obtain N=550 (2*275), one had to use something like p2=0.8216. (See &lt;A href="https://support.sas.com/resources/papers/proceedings15/SAS1911-2015.pdf" target="_blank"&gt;this paper&lt;/A&gt;, p. 12, for the relationship between TEST=PCHI and the Wald test.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the JAMA article (p. 2342) it looks as if they intended to achieve a 95% CI with a lower bound of 0.75. On p. 2343 it says "Noninferiority ... was tested using 1-sided Wald tests" (which is not a contradiction).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may be a coincidence that the sample size for a similar &lt;EM&gt;one-sample&lt;/EM&gt; test is N=549 (!):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc power;
onesamplefreq 
test=z
method=normal
varest=sample
nullp=0.99
p=0.80
margin = -0.24
power = 0.9
alpha = 0.05
sides = U
ntotal = .;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(Note, however, that these 549 are for &lt;EM&gt;one&lt;/EM&gt; group. They must not be divided by 2.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know how they arrived at 275 per group. But it's always good to double-check results. So, let's finally check our result N=1258 (629 per group) by means of a simulation:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Simulate 100000 trials with 629 patients per group and true success probabilities 
   p1=0.99 and p2=0.80 */

data sim(drop=ng) / view=sim;
call streaminit(27182818);
length grp $8;
ng=629;
do i=1 to 100000;
  grp='surgery';
  success=1; /* 1=yes */
  n=rand('binom',0.99,ng);
  output;
  success=2; /* 2=no */
  n=ng-n;
  output;
  grp='antibiot';
  success=1;
  n=rand('binom',0.80,ng);
  output;
  success=2;
  n=ng-n;
  output;
end;
run;

/* Perform the noninferiority tests */

ods select none;
ods noresults;
ods output PdiffNoninf=pdn;
proc freq data=sim;
by i;
weight n;
tables grp*success / alpha=0.05 riskdiff(noninf margin=0.24 method=fm);
run;
ods select all;

/* Check the proportion of trials in which H0 would have been rejected */

proc format;
value pdiff
low - -0.24 = '&amp;lt;=-0.24'
-0.24&amp;lt;-high = '&amp;gt; -0.24';
run;

proc freq data=pdn;
format lowerCL pdiff.;
tables lowerCL / binomial(level=2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(run time: about 34 s on my workstation)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;                                    Cumulative    Cumulative
LowerCL    Frequency     Percent     Frequency      Percent
------------------------------------------------------------
&amp;lt;=-0.24       10072       10.07         10072        10.07
&amp;gt; -0.24       89928       89.93        100000       100.00


      Binomial Proportion
       LowerCL = &amp;gt; -0.24

Proportion                0.8993
ASE                       0.0010
95% Lower Conf Limit      0.8974
95% Upper Conf Limit      0.9011

Exact Conf Limits
95% Lower Conf Limit      0.8974
95% Upper Conf Limit      0.9011&lt;/PRE&gt;
&lt;P&gt;(Please note that &lt;FONT face="courier new,courier"&gt;LowerCL&lt;/FONT&gt; is the lower bound of a two-sided 90% CI and hence of a one-sided 95% CI, which is what the authors used.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This result confirms that with 629 patients per group, not 275, a power of 90% would have been achieved (with the Farrington-Manning test, though, not the Wald test).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[Edit: only minor typo corrected]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Sep 2018 07:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sample-size-calculation/m-p/491924#M25532</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-09-03T07:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: sample size calculation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/sample-size-calculation/m-p/492286#M25544</link>
      <description>&lt;P&gt;Thank you very much for taking time to answer my question.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Sep 2018 13:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/sample-size-calculation/m-p/492286#M25544</guid>
      <dc:creator>Kyra</dc:creator>
      <dc:date>2018-09-04T13:47:22Z</dc:date>
    </item>
  </channel>
</rss>

