oddsratio.conf: Confidence Functions for the Odds Ratio Between Two...

Description Usage Arguments Value References Examples

View source: R/prop.R

Description

Confidence functions for the odds ratio between two binomial proportions based on the mid P-value for the exact test.

Usage

1
oddsratio.conf(x, n, plot = TRUE, conf.level = 0.95, log = "")

Arguments

x

a vector of counts of successes in each independent sample

n

a vector of the number of trials in each independent sample

plot

whether to plot the confidence density and curve

conf.level

the confidence level for the confidence interval indicated on the confidence curve

log

'x' to plot odds ratio on log-scale

Value

A list containing the confidence functions pconf, dconf, cconf, and qconf for the relative risk between two proportions, as well as the P-curve and S-curve.

References

Tore Schweder and Nils Lid Hjort. Confidence, likelihood, probability. Vol. 41. Cambridge University Press, 2016.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# From Physician's Health Study, on whether regular
# intake of aspirin reduces the rate of heart disease.
#
# Data:
#
#         | Yes |   No  | Total
# -----------------------------
# Placebo | 189 | 10845 | 11034
# Aspirin | 104 | 10933 | 11037

x <- c(189, 104)
n <- c(11034, 11037)

oddsratio.conf(x, n)

oddsratio.conf(x, n, log = 'x') # Show odds ratio with
                                # log-scaling of horizontal axis.

ddarmon/clp documentation built on Jan. 25, 2021, 6:22 p.m.