Learn R Programming

dlookr (version 0.6.3)

cramer: Cramer's V statistic

Description

Computes the Cramer's V statistic and Chisquare p value between two categorical variables in data.frame.

Usage

cramer(dfm, x, y)

Value

data.frame. It has the following variables.:

  • var1 : character. first variable name.

  • var2 : character. second variable name.

  • chisq : numeric. Chisquare statistic.

  • df : integer. degree of freedom.

  • pval : numeric. p value of Chisquare test.

  • coef_corr : numeric. Cramer's V statistic.

Arguments

dfm

data.frame. probability distributions.

x

character. name of categorical or discrete variable.

y

character. name of another categorical or discrete variable.

See Also

theil.

Examples

Run this code
cramer(mtcars, "gear", "carb")

Run the code above in your browser using DataLab