prec_or: Sample size or precision for an odds ratio

Description Usage Arguments Details Value References

View source: R/differences.R

Description

prec_or returns the sample size or the precision for the provided proportions

Usage

1
2
3
prec_or(p1, p2, n1 = NULL, r = 1, conf.width = NULL,
  conf.level = 0.95, method = c("gart", "woolf", "indip_smooth"),
  tol = .Machine$double.eps^0.25)

Arguments

p1

Risk among unexposed

p2

Risk among exposed

n1

Number of patients in unexposed group

r

allocation ratio (relative size of unexposed and exposed cohort (n1 / n2))

conf.width

precision (the full width of the conficende interval)

conf.level

confidence level

method

Exactly one of indip_smooth (default), gart, or wolf. Methods can be abbreviated.

tol

numerical tolerance used in root finding, the default providing (at least) four significant digits

Details

Exactly one of the parameters n, conf.width must be passed as NULL, and that parameter is determined from the other.

Woolf (woolf), Gart (gart), and Independence-smoothed logit (indip_smooth) belong to a general family of adjusted confidence intervals, adding 0 (woolf) to each cell, 0.5 (gart) to each cell, or an adjustment for each cell based on observed data (independence-smoothed). In gart and indip_smooth, estimate of the CI is not possible if p1 = 0, in which case the OR becomes 0, but the lower level of the CI is > 0. Further, if p1 = 1 and p2 < 1, or if p1 > 0 and p2 = 0, the OR becomes , but the upper limit of the CI is finite. For the approximate intervals, gart and indip_smooth are the recommended intervals (Fagerland et al. 2011).

uniroot is used to solve n for the woolf, gart, and indip_smooth method.

Value

Object of class "presize", a list of arguments (including the computed one) augmented with method and note elements.

References

Fagerland MW, Lydersen S, Laake P (2015). Recommended confidence intervals for two independent binomial proportions. Statistical Methods in Medical Research, 24(2):224-254. doi:10.1177/0962280211415469


a-lenz/presize documentation built on May 17, 2019, 7:44 a.m.