| log_odds_ratio | R Documentation |
Calculate log odds ratio (i.e., ln of odds ratio), as illustrated in Borenstein et al. (2009, p. 36, ISBN: 978-0-470-05724-7)
log_odds_ratio( data = NULL, iv_name = NULL, dv_name = NULL, contingency_table = NULL, ci = 0.95, var_include = FALSE, invert = FALSE )
data |
a data object (a data frame or a data.table) |
iv_name |
name of the independent variable (grouping variable) |
dv_name |
name of the dependent variable (binary outcome) |
contingency_table |
a contingency table, which can be directly entered as an input for calculating the odds ratio |
ci |
width of the confidence interval. Input can be any value
less than 1 and greater than or equal to 0. By default, |
var_include |
logical. Should the output include variance of the log of odds ratio? (default = FALSE) |
invert |
logical. Whether the inverse of the odds ratio (i.e., 1 / odds ratio) should be returned. |
## Not run: log_odds_ratio(data = mtcars, iv_name = "vs", dv_name = "am") log_odds_ratio(contingency_table = matrix(c(5, 10, 95, 90), nrow = 2)) log_odds_ratio(contingency_table = matrix(c(5, 10, 95, 90), nrow = 2), invert = TRUE) log_odds_ratio(contingency_table = matrix(c(34, 39, 16, 11), nrow = 2)) log_odds_ratio(contingency_table = matrix(c(34, 39, 16, 11), nrow = 2), var_include = TRUE) ## End(Not run)