EVOLUTION-MANAGER
Edit File: power.prop.test.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Power Calculations for Two-Sample Test for Proportions</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for power.prop.test {stats}"><tr><td>power.prop.test {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Power Calculations for Two-Sample Test for Proportions</h2> <h3>Description</h3> <p>Compute the power of the two-sample test for proportions, or determine parameters to obtain a target power. </p> <h3>Usage</h3> <pre> power.prop.test(n = NULL, p1 = NULL, p2 = NULL, sig.level = 0.05, power = NULL, alternative = c("two.sided", "one.sided"), strict = FALSE, tol = .Machine$double.eps^0.25) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>n</code></td> <td> <p>number of observations (per group)</p> </td></tr> <tr valign="top"><td><code>p1</code></td> <td> <p>probability in one group</p> </td></tr> <tr valign="top"><td><code>p2</code></td> <td> <p>probability in other group</p> </td></tr> <tr valign="top"><td><code>sig.level</code></td> <td> <p>significance level (Type I error probability)</p> </td></tr> <tr valign="top"><td><code>power</code></td> <td> <p>power of test (1 minus Type II error probability)</p> </td></tr> <tr valign="top"><td><code>alternative</code></td> <td> <p>one- or two-sided test. Can be abbreviated.</p> </td></tr> <tr valign="top"><td><code>strict</code></td> <td> <p>use strict interpretation in two-sided case</p> </td></tr> <tr valign="top"><td><code>tol</code></td> <td> <p>numerical tolerance used in root finding, the default providing (at least) four significant digits.</p> </td></tr> </table> <h3>Details</h3> <p>Exactly one of the parameters <code>n</code>, <code>p1</code>, <code>p2</code>, <code>power</code>, and <code>sig.level</code> must be passed as NULL, and that parameter is determined from the others. Notice that <code>sig.level</code> has a non-NULL default so <code>NULL</code> must be explicitly passed if you want it computed. </p> <p>If <code>strict = TRUE</code> is used, the power will include the probability of rejection in the opposite direction of the true effect, in the two-sided case. Without this the power will be half the significance level if the true difference is zero. </p> <p>Note that not all conditions can be satisfied, e.g., for </p> <pre>power.prop.test(n=30, p1=0.90, p2=NULL, power=0.8, strict=TRUE)</pre> <p>there is no proportion <code>p2</code> between <code>p1 = 0.9</code> and 1, as you'd need a sample size of at least <i>n = 74</i> to yield the desired power for <i>(p1,p2) = (0.9, 1)</i>. </p> <p>For these impossible conditions, currently a warning (<code><a href="../../base/html/warning.html">warning</a></code>) is signalled which may become an error (<code><a href="../../base/html/stop.html">stop</a></code>) in the future. </p> <h3>Value</h3> <p>Object of class <code>"power.htest"</code>, a list of the arguments (including the computed one) augmented with <code>method</code> and <code>note</code> elements. </p> <h3>Note</h3> <p><code><a href="uniroot.html">uniroot</a></code> is used to solve power equation for unknowns, so you may see errors from it, notably about inability to bracket the root when invalid arguments are given. If one of <code>p1</code> and <code>p2</code> is computed, then <i>p1 < p2</i> is assumed and will hold, but if you specify both, <i>p2 <= p1</i> is allowed. </p> <h3>Author(s)</h3> <p>Peter Dalgaard. Based on previous work by Claus Ekstrøm</p> <h3>See Also</h3> <p><code><a href="prop.test.html">prop.test</a></code>, <code><a href="uniroot.html">uniroot</a></code></p> <h3>Examples</h3> <pre> power.prop.test(n = 50, p1 = .50, p2 = .75) ## => power = 0.740 power.prop.test(p1 = .50, p2 = .75, power = .90) ## => n = 76.7 power.prop.test(n = 50, p1 = .5, power = .90) ## => p2 = 0.8026 power.prop.test(n = 50, p1 = .5, p2 = 0.9, power = .90, sig.level=NULL) ## => sig.l = 0.00131 power.prop.test(p1 = .5, p2 = 0.501, sig.level=.001, power=0.90) ## => n = 10451937 try( power.prop.test(n=30, p1=0.90, p2=NULL, power=0.8) ) # a warning (which may become an error) ## Reason: power.prop.test( p1=0.90, p2= 1.0, power=0.8) ##-> n = 73.37 </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>