cramersV: Calculate Cramer's V

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Returns the value of Cramer's V for each variable pair in the supplied data frame

Usage

1
cramersV(y, fill = TRUE, na.rm = TRUE)

Arguments

y

A data frame comprising 2+ variables

fill

Default value TRUE. If FALSE, then only correlations in the upper-right hand of the correlation matrix are returned with all other values in the matrix being set to NA.

na.rm

If TRUE (default) observations with a missing value of x or y are removed before applying the test; else if FALSE returns a value of NA for each variable pair with one or more missing x or y values.

Details

For each variable pair the value of Cramer's V is calculated via a call to the function cramersV.test.

For a variable pair including a continuous variable Cramer's V is undefined (NA). Note, however, that continuous variables with up to 20 unique values are treated as categorical, allowing a valid value of Cramer's V to be returned.

Value

cramersV Returns a data frame storing the calculated Cramer's V correlation matrix.

Author(s)

Paul Williamson

See Also

cramersV.test; cramersV.results

Examples

1
2
3
4
5
## Default setting
cramersV(survey[, 3:8])

## fill = FALSE
cramersV(survey[, 3:8], fill=FALSE)

DrPaulWilliamson/ENVS450 documentation built on May 9, 2019, 3:23 a.m.