powered by
Calculate risk difference and 95 percent confidence interval using Wald method.
# S3 method for matrix riskdiff(df, conf.level = 0.95, dnn = NULL, rev = c("neither", "rows", "columns", "both"), ...)
a 2 x 2 frequency matrix.
confidence level for confidence interval, default is 0.95.
optional character vector of dimension names.
reverse order of cells. Options are "row", "columns", "both", and "neither" (default).
further arguments passed to or from other methods.
a list with class "rdiff" containing the following components:
risk difference
specified confidence level
calculated confidence interval
proportion one
proportion two
2x2 table using for calculating risk difference
# NOT RUN { matrix(c(12, 45, 69, 15), nrow = 2, ncol = 2) %>% riskdiff(dnn = c("New Drug", "Adverse Outcome")) # }
Run the code above in your browser using DataLab