title: pairwise comparisons between pairs of proportions in R with a correction for some multiple testing rather all possible multiple testing
body: <p>Is it possible to get the multiple comparison adjustment in <code>pairwise.prop.test()</code> to use less than the full number of comparisons? For example, if I only care about 4 vs 1,2,3 (3 comparisons) below, I would multiply the p-values in the bottom row by 3 instead of 6 (which is the full number of pairwise comparisons) to do the Bonferroni adjustment. p.adjust has the n argument, but I can't figure out how to pass it through by doing something like</p>
  <pre><code>pairwise.prop.test(x=b$s,n=b$pop,p.adjust.method=&quot;bonferroni&quot;, p.adjust.n = 3, alternative=&quot;two.sided&quot;, correct = FALSE)
  </code></pre>
  <p>With Bonferroni, it's trivial, but much more involved with the other types of corrections.</p>
  <p>Here's the result (with code below):</p>
  <pre><code>&gt; b &lt;- data.frame(
  +     s=c(18,53,49,30),
  +   pop=c(29,100,88,73),
  +   reg=c(&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;)
  + )
  &gt; pairwise.prop.test(x=b$s,n=b$pop,p.adjust.method=&quot;none&quot;,alternative=&quot;two.sided&quot;, correct = FALSE)
  
      Pairwise comparisons using Pairwise comparison of proportions 
  
  data:  b$s out of b$pop 
  
    1     2     3    
  2 0.387 -     -    
  3 0.547 0.713 -    
  4 0.056 0.122 0.065
  
  P value adjustment method: none 
  &gt; pairwise.prop.test(x=b$s,n=b$pop,p.adjust.method=&quot;bonferroni&quot;, alternative=&quot;two.sided&quot;, correct = FALSE)
  
      Pairwise comparisons using Pairwise comparison of proportions 
  
  data:  b$s out of b$pop 
  
    1    2    3   
  2 1.00 -    -   
  3 1.00 1.00 -   
  4 0.33 0.73 0.39
  
  P value adjustment method: bonferroni 
  </code></pre>
  <hr />
  <p><strong>Code:</strong></p>
  <pre><code>b &lt;- data.frame(
      s=c(18,53,49,30),
    pop=c(29,100,88,73),
    reg=c(&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;4&quot;)
  )
  pairwise.prop.test(x=b$s,n=b$pop,p.adjust.method=&quot;none&quot;,alternative=&quot;two.sided&quot;, correct = FALSE)
  pairwise.prop.test(x=b$s,n=b$pop,p.adjust.method=&quot;bonferroni&quot;, alternative=&quot;two.sided&quot;, correct = FALSE)
  </code></pre>