log_odds_dc {covalchemy} | R Documentation |
Log-Odds Calculation for Concordant and Discordant Pairs
Description
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.
Usage
log_odds_dc(tab)
Arguments
tab |
A contingency table (matrix or data frame) containing counts of pairs for each combination of outcomes. |
Value
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.
Examples
# Example contingency table
tab <- matrix(c(10, 5, 7, 8), nrow = 2)
log_odds_dc(tab)
[Package covalchemy version 1.0.0 Index]