View source: R/helper.functions.r
tablesomersDC | R Documentation |
Given a table of conditional frequencies, tablesomersDC calculates and returns Somers' D, a measure of association between two ordinal-level variables.
tablesomersDC(tab, dep = 1, digits = 3)
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). |
Returns the value of Somers' D.
library(RCPA3)
conditional.frequencies <- table(dv=states$lgbtq.equality.3cat, iv=states$religiosity3)
tablesomersDC(tab=conditional.frequencies)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.