log_odds_dc | R Documentation |
This function calculates the log-odds ratio for concordant and discordant pairs based on the contingency table provided. The log-odds ratio is defined as the natural logarithm of the ratio of concordant to discordant pairs.
log_odds_dc(tab)
tab |
A contingency table (matrix or data frame) containing counts of pairs for each combination of outcomes. |
The log-odds ratio calculated as the natural logarithm of the ratio of
concordant pairs to discordant pairs. If discordant pairs are zero,
it returns Inf
to avoid division by zero.
# Example contingency table
tab <- matrix(c(10, 5, 7, 8), nrow = 2)
log_odds_dc(tab)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.