Created
October 15, 2018 08:43
-
-
Save zhjgithub/e2ea28ef1aafd741b606e8e226fe2d2f to your computer and use it in GitHub Desktop.
To compute the measure of correlation between two Boolean variables. The output of the formula is a number between -1 and 1 that describes the correlation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function phi([n00, n01, n10, n11]) { | |
return (n11 * n00 - n10 * n01) / | |
Math.sqrt((n10 + n11) * | |
(n00 + n01) * | |
(n01 + n11) * | |
(n00 + n10)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment