Description Usage Arguments Details Value References See Also Examples
Compute the power of risk difference, risk ratio and odds ratio methods for closed cohort studies, or determine parameters to obtain a target power.
1 2 3 |
n |
number of observations |
delta |
The true risk difference (RD), risk ratio (RR) or odds ratio (OR), depending on |
p2 |
probability that someone without a history of exposure will develop the disease |
rho |
The ratio of unexposed to exposed subjects |
sig.level |
significance level (Type I error probability) |
power |
power of test (1 minus Type II error probability) |
type |
type of measurement: |
alternative |
one- or two-sided test. Can be abbreviated. |
tol |
numerical tolerance used in root finding, the default providing (at least) four significant digits.
Root finding refers to |
Exactly one of the parameters n and power must be passed as NULL, and that parameter is determined from the others.
Object of class "power.htest", a list of the arguments (including the computed one) augmented
with method and note elements. Sample size is returned as r1
and r2
. r1 is number of exposed
subjects and r2 is number of unexposed subjects. r2 is equal to r1 * rho.
Newman (2001), pages 283 - 285
power.prop.test
which can perform Risk Difference power calculations assuming rho = 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Example 14.2 (row 1 of Table 14.2)
power.closed.cohort(delta = 0.01, p2 = 0.05, rho = 1, type = "RD", power = 0.80)
## Table 14.2
sapply(c(0.01, 0.05, 0.10, 0.20, 0.30),
function(x)power.closed.cohort(delta = x, p2 = 0.05, rho = 1, power = 0.8)$r1)
## Table 14.3
sapply(lapply(c(1:5,10,20),
function(x)power.closed.cohort(delta = 0.05, rho = x, power = 0.8, p2 = 0.05)),
function(x)x[1:2])
## Example 14.5 (row 2 of Table 14.4)
power.closed.cohort(delta = 3, p2 = 0.05, rho = 1, power = 0.8, type = "OR")
## Table 14.4
sapply(c(2:5,10), function(x)power.closed.cohort(delta = x, p2 = 0.05,
rho = 1, power = 0.8, type = "OR")$r1)
## Example 14.7
power.closed.cohort(n = 100, delta = 2, p2 = 0.10, rho = 2, type = "OR")
## Example 14.8
power.closed.cohort(rho = 6.73, p2 = 0.048, delta = 3, power = 0.8, type = "OR")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.