Learn R Programming

RCPA3 (version 1.3.1)

tablesomersDC: 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)

Value

Returns the value of Somers' D.

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

Examples

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

Run the code above in your browser using DataLab