power.closed.cohort: Power calculations for unstratified closed cohort studies

Description Usage Arguments Details Value References See Also Examples

Description

Compute the power of risk difference, risk ratio and odds ratio methods for closed cohort studies, or determine parameters to obtain a target power.

Usage

1
2
3
power.closed.cohort(n = NULL, delta, p2, rho = 1, sig.level = 0.05,
  power = NULL, type = c("RD", "RR", "OR"), alternative = c("two.sided",
  "one.sided"), tol = .Machine$double.eps^0.25)

Arguments

n

number of observations

delta

The true risk difference (RD), risk ratio (RR) or odds ratio (OR), depending on type selected.

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: RD = "Risk Difference", RR = "Risk Ratio", and OR = "Odds Ratio"

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 uniroot, which is used to find sample size given power.

Details

Exactly one of the parameters n and power must be passed as NULL, and that parameter is determined from the others.

Value

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.

References

Newman (2001), pages 283 - 285

See Also

power.prop.test which can perform Risk Difference power calculations assuming rho = 1

Examples

 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")

clayford/bme documentation built on May 13, 2019, 7:37 p.m.