Skip to contents

Generalized Correlation function

Usage

GeneralCor(df, cor1 = "pearson", cor2 = "polychoric", cor3 = "spearman")

Arguments

df

The imported Data Frame

cor1

The correlation metric between two continuous features. Defaults to pearson

cor2

The correlation metric between one categorical feature and one cont feature. Defaults to biserial

cor3

The correlation metric between two categorical features. Defaults to Cramers-V

Value

Returns a correlation matrix containing the correlation values between the features

Examples

GeneralCor(df = TangledFeatures::Advertisement)
#>                   TV      Radio  Newspaper     Sales
#> TV        1.00000000 0.05480866 0.05664787 0.7822244
#> Radio     0.05480866 1.00000000 0.35410375 0.5762226
#> Newspaper 0.05664787 0.35410375 1.00000000 0.2282990
#> Sales     0.78222442 0.57622257 0.22829903 1.0000000