Learn R Programming

scorecardModelUtils (version 0.0.1.0)

cv_test: Cramer's V value between two categorical variables

Description

The function gives the pairwise Cramer's V value between two input categorical variables.

Usage

cv_test(base, var_1, var_2)

Arguments

base

input dataframe

var_1

categorical variable name, to be passed as string

var_2

categorical variable name, to be passed as string

Value

The function returns a dataframe with pairwise CV value.

Examples

Run this code
# NOT RUN {
data <- iris
data$Species <- as.character(data$Species)
data$Sepal.Length <- as.character(floor(data$Sepal.Length))
data$Y <- sample(0:1,size=nrow(data),replace=TRUE)
cv_result <- cv_test(base = data,var_1 = "Species",var_2 = "Sepal.Length")
# }

Run the code above in your browser using DataLab