tablesomersDC {RCPA3} | R 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)
[Package RCPA3 version 1.2.1 Index]