association.measures: Measures of association

Description Usage Arguments Value See Also Examples

Description

This function calculates basic measures of association

Usage

1

Arguments

x

a table or matrix if y is NULL, or a numeric vector for the row variable

y

the column variable, a numeric vector used only when x is not a table or matrix.

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 x and y

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

1
2
3
4
5
6
7
#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)

oii documentation built on May 2, 2019, 6:33 a.m.