riskratio.estimation {epitools} | R Documentation |
Estimates risk ratio using different methods and performs Fisher's exact test for testing the null of independence of rows and columns in a contingency table with fixed marginals.
riskratio.crude(...) riskratio.ss(...)
... |
A 2x2 table or equivalent. See as.epitable
for details. |
These functions calculate the risk ratio using different methods and performs Fisher's exact test for testing the null of independence of rows and columns in a contingency table with fixed marginals. These functions calculate the risk ratio for the following type of 2x2 contingency table (opposite of how data is displayed in epidemiology textbooks, but consistent with how data is handled in statistical programs):
Outcome Exposure No Yes No (ref) a b Yes c d
The riskratio.crude
function calculates the risk ratio using
d/(c + d))/(b/(a + b).
The riskratio.ss
function calculates the risk ratio using a
small sample (ss) adjustment (Jewell 2004):
d/(c + d))/((b + 1)/(a + b + 1).
$data |
original data |
$risks |
proportion exposed for each outcome category |
$estimate |
odds ratio |
$fishers.exact |
p value |
Visit http://www.epitools.net for the latest.
Tomas Aragon, aragon@berkeley.edu, http://www.medepi.net/aragon
Nicholas P. Jewell (2004), Statistics for Epidemiology, Chapman & Hall, 1st Edition
See also oddsratio.estimation
, as.epitable
, epitab
##From Jewell (2004), p. 79 riskratio.crude(88, 20, 555, 347) riskratio.ss(88, 20, 555, 347) dat <- matrix(c(88, 20, 555, 347), 2, 2, byrow = TRUE) dimnames(dat) <- list (c("0", ">=1"), c("Controls", "Cases")) names(dimnames(dat)) <- c("Coffee (cups/day)", "Pancreatic Cancer") dat riskratio.crude(dat) riskratio.ss(dat)