R/SimilarityMatrix.R

Defines functions SimilarityMatrix

## eigenstrat Correlation Matrix
SimilarityMatrix <- function(x, k)
{
    x <- x/2
    if( k>1 ) 
    {
        z <- apply(x, 1, ModifyNormalization)
    }    
    else 
    {
        z <- ModifyNormalization(x)
        z <- matrix(z, ncol=1)
    }

    z %*% t(z)
}

Try the AssocTests package in your browser

Any scripts or data that you put into this service are public.

AssocTests documentation built on Jan. 13, 2021, 5:09 a.m.