Description Usage Arguments Value Examples
rmnegcorr
removes "negative correlations" from a correlation matrix.
A negative correlation is defined as a relation between to variables/objects,
that have a high correlation value due to NOT frequently appearing together.
This function can be applied for correlation matrizes created for variable or
object relations.
1 |
corrmatrix |
correlation matrix (as produced by varnastats::corrmat()) |
matrix |
underlying data.frame |
dim |
switch to define if the correlation matrix should be created for columns or rows. 1: table is created for column (variables) relations. 2: table is created for row (objects) relations. |
niv |
decision niveau. The smaller niv the weaker the overlap of two variables/objects can be, to still be recognised as the cause for a positiv relation. default: 0.1 -> 10% |
correlation matrix without negative relations
1 2 3 4 5 6 7 8 9 10 | testmatrixrand <- data.frame(
matrix(base::sample(0:1,400,replace=TRUE), nrow=20, ncol=20)
)
testmatrixrand[,1] <- c(1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0)
testmatrixrand[,2] <- c(0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1)
testcorr <- corrmat(testmatrixrand, "chi2", chi2limit = 0.1, dim = 1)
rmnegcorr(testcorr, testmatrixrand, dim = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.