tablesomersDC: Calculates the Somers' d measure of association for a...

View source: R/helper.functions.r

tablesomersDCR Documentation

Calculates the Somers' d measure of association for a cross-tabulation.

Description

Given a table of conditional frequencies, tablesomersDC calculates and returns Somers' D, a measure of association between two ordinal-level variables.

Usage

tablesomersDC(tab, dep = 1, digits = 3)

Arguments

tab

The conditional frequencies of a cross-tabulation. The dependent and independent variable in cross-tabulation should be be ordinal-level (ordered factors).

dep

which dimension stands for the dependent variable (1 = ROWS, 2 = COLS), default is 2.

digits

Number of decimal places reported in result (defaults to 3).

Value

Returns the value of Somers' D.

Examples

  library(RCPA3)
  
  conditional.frequencies <- table(dv=states$lgbtq.equality.3cat, iv=states$religiosity3)
  tablesomersDC(tab=conditional.frequencies)

RCPA3 documentation built on May 29, 2024, 12:19 p.m.

Related to tablesomersDC in RCPA3...