log_odds_dc: Log-Odds Calculation for Concordant and Discordant Pairs

View source: R/log_odds_dc.R

log_odds_dcR 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)


covalchemy documentation built on April 12, 2025, 2:15 a.m.