riskdiff.matrix {catfun} | R Documentation |
Risk difference
Description
Calculate risk difference and 95 percent confidence interval using Wald method.
Usage
## S3 method for class 'matrix'
riskdiff(df, conf.level = 0.95, dnn = NULL,
rev = c("neither", "rows", "columns", "both"), ...)
Arguments
df |
a 2 x 2 frequency matrix. |
conf.level |
confidence level for confidence interval, default is 0.95. |
dnn |
optional character vector of dimension names. |
rev |
reverse order of cells. Options are "row", "columns", "both", and "neither" (default). |
... |
further arguments passed to or from other methods. |
Value
a list with class "rdiff" containing the following components:
rd |
risk difference |
conf.level |
specified confidence level |
ci |
calculated confidence interval |
p1 |
proportion one |
p2 |
proportion two |
tab |
2x2 table using for calculating risk difference |
Examples
matrix(c(12, 45, 69, 15), nrow = 2, ncol = 2) %>%
riskdiff(dnn = c("New Drug", "Adverse Outcome"))
[Package catfun version 0.1.4 Index]