association.measures {oii} | R Documentation |
Measures of association
Description
This function calculates basic measures of association
Usage
association.measures(x, y = NULL, warnings = FALSE)
Arguments
x |
a table or matrix if |
y |
the column variable, a numeric vector used only when |
warnings |
a logical value indicating whether warnings should be shown (defaults to FALSE, no warnings). |
Value
A list with the following elements is returned:
phi |
Phi, a chi-square-based measures of association. |
contingency_coefficient |
Contingency coefficient, a chi-square-based measures of association. |
cramersv |
Cramer's V, a chi-square-based measures of association. |
pairs_total |
Total number of pairs |
pairs_concordant |
Number of concordant pairs |
pairs_discordant |
Number of discordant pairs |
pairs_tied_first |
The number of pairs tied on the first variable (but not both variables) |
pairs_tied_second |
The number of pairs tied on the second variable (but not both variables) |
pairs_tied_both |
The number of pairs tied on both the first and second variables |
minimum_dim |
Minimum dimension of |
n |
Number of cases |
gamma |
Goodman-Kruskal Gamma |
somersd |
Somers' d (assuming the column variable is the dependent variable) |
taub |
Kendall's tau-b |
tauc |
Stuart's tau-c |
See Also
oii.xtab
, likelihood.test
, lambda.test
,
concordant.pairs
, discordant.pairs
, tied.pairs
Examples
#Create var1 as 200 A's, B's, and C's
var1<-sample(LETTERS[1:3],size=200,replace=TRUE)
#Create var2 as 200 numbers in the range 1 to 4
var2<-sample(1:4,size=200,replace=TRUE)
#Print a simple cross tab of var1 and var2
association.measures(var1,var2)