liu_agresti_ccor: Liu-Agresti Common Cumulative Odds Ratio

View source: R/liu_agresti_ccor.R

liu_agresti_ccorR Documentation

Liu-Agresti Common Cumulative Odds Ratio

Description

Computes the Liu-Agresti estimate of the common cumulative odds ratio (\Psi) and its reciprocal (\alpha) for ordinal data from two independent groups. This statistic quantifies the direction and strength of ordinal association between groups.

Usage

liu_agresti_ccor(responses, group)

Arguments

responses

A numeric vector of ordinal item responses. Categories must be coded as integers (e.g., 1 to 5 for a Likert-type scale).

group

A grouping vector indicating the group to which each observation belongs. It must contain exactly two unique values (e.g., "ref" and "foc").

Details

This function creates a 2 x J contingency table, where J is the number of distinct ordinal response categories. It computes cumulative marginal frequencies and estimates the odds ratio using Liu and Agresti's formulation (1996, Eq. 2). The variance of the log-transformed estimate is computed according to their Eq. 3.

The estimate \hat{\Psi} is based on cumulative frequencies and is designed for ordinal response categories. It quantifies the association between group membership and the likelihood of higher category responses.

The function does not support missing values; observations with NA should be removed prior to use.

If one of the response categories is completely absent from one group, then the cumulative margins used in the computation may contain zero values. In such cases, either the numerator or the denominator of the Liu-Agresti formula will be zero, making the estimate undefined. When this occurs, the function returns NA and issues a warning.

About the notation: In the original article by Liu and Agresti (1996), the cumulative logistic model uses the parameters \beta and \theta. To avoid any confusion with a logistic model or the IRT framework, the symbol \psi is used here to denote the group effect.

Value

A matrix with one row and three columns containing:

Psi_hat

The Liu-Agresti estimate of the common cumulative odds ratio (\hat{\Psi}).

Alpha_hat

The reciprocal of \hat{\Psi}.

SE_log_Psi

The standard error of \log(\hat{\Psi}), which can be used to construct confidence intervals or conduct hypothesis testing.

Author(s)

Sebastien Beland
Faculte des sciences de l'education
Universite de Montreal (Canada)
sebastien.beland@umontreal.ca

References

Liu, I., & Agresti, A. (1996). Mantel-Haenszel-Type Inference for Cumulative Odds Ratios with a Stratified Ordinal Response. Biometrics, 52(4), 1223–1234.

Examples

# Simulated balanced example
set.seed(123)

group <- rep(c("ref", "foc"), each = 100)  
stopifnot(length(group) == 200)

responses <- sample(1:4, size = length(group), replace = TRUE)
stopifnot(length(responses) == length(group))  

liu_agresti_ccor(as.integer(responses), factor(group))

difR documentation built on June 8, 2025, 1:03 p.m.