Title: | Measurement Level Independent Feature Correlation Matrix |
---|---|
Description: | Uses three different correlation coefficients to calculate measurement-level adequate correlations in a feature matrix: Pearson product-moment correlation coefficient, Intraclass correlation and Cramer's V. |
Authors: | Guido Moeser [aut, cre], Ilja Muhl [aut] |
Maintainer: | Guido Moeser <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.4.0 |
Built: | 2024-11-01 11:24:14 UTC |
Source: | https://github.com/cran/featureCorMatrix |
cv.test
returns the Cramer's V correlation coefficient
cv.test(x, y)
cv.test(x, y)
x |
a vector (categorical or numerical values) |
y |
a vector (categorical or numerical values) |
The function calculates Cramer's V based on the results of an Chi-Square-Test of Independence between two categorical variables
Cramer's V
cv.test(x = iris$Species, iris$Sepal.Length)
cv.test(x = iris$Species, iris$Sepal.Length)
featureCorMatrix
returns a correlation matrix between all features
featureCorMatrix(dataframe, absoluteValues = FALSE)
featureCorMatrix(dataframe, absoluteValues = FALSE)
dataframe |
A data.frame |
absoluteValues |
A flag stating if only positive correlations should be returned |
The function selects automatically the appropriate correlation coefficient regarding the storage type of both variables - If both variable are numerical ones, the Pearson product-moment correlation coefficient will be chosen - If both variables are categorical, Cramer's V will be used - If one variable is a numerical and the other a categorical one, the Intraclass correlation will be calculated
A correlation matrix
featureCorMatrix(dataframe = iris, absoluteValues = TRUE)
featureCorMatrix(dataframe = iris, absoluteValues = TRUE)
This dataset classifies people described by a set of attributes as good or bad credit risks.
The variables are as follows:
Credit. Target variable
balance_credit_acc. Status of existing checking account
duration. Duration in month
moral. Credit history
verw. Purpose
hoehe. Credit amount
sparkont. Savings account/bonds
beszeit. Present employment since
rate. Installment rate in percentage of disposable income
famges. Personal status and sex
buerge. Other debtors / guarantors
wohnzeit. Present residence since
verm. Property
alter. Age in years
weitkred. Other installment plans
wohn. Housing
bishkred. Number of existing credits at this bank
beruf. Job
pers. Number of people being liable to provide maintenance for
telef. Telephone
gastarb. Foreign worker
data(GermanCredit)
data(GermanCredit)
A data frame with 1000 rows and 21 variables
UCI Repository, https://archive.ics.uci.edu/ml/datasets/statlog+(german+credit+data)
The function calculates the Intraclass correlation based on the results of the 'aov' function
icc(depvar, indvar)
icc(depvar, indvar)
depvar |
dependent variable, must be numeric |
indvar |
independent variable, must be categorical |
returns the Intraclass correlation
icc(depvar = iris$Sepal.Length, indvar = iris$Species)
icc(depvar = iris$Sepal.Length, indvar = iris$Species)