Calculate pariwise association of data with mixed types of variables
pairwise_cor.Rd
Calculate pariwise association of data with mixed types of variables
Arguments
- df
dataframe with mixed types of variables
- var_type
a charater vector corresponding to types of variables in df
Details
The following associated measures and tests are implemented dependent on variable type:
factor vs numeric, factor or ordinal: Pseudo R^2 and p value from multinomial regression
ordinal vs ordinal or numeric: GK gamma and GK gamma correlation test
numeric vs numeric: Spearman correlation and p value
Examples
data1 <- data.frame(x = rnorm(10),
y = rbinom(10, 1, 0.5),
z = rbinom(10, 5, 0.5))
type1 <- c("numeric", "factor", "ordinal")
pairwise_cor(data1, type1)
#> Error in pairwise_cor(data1, type1): could not find function "pairwise_cor"