calculating correlation between binary vectors with generating with uniform distribution I am working with some correlated binary files. I want to know, what is your opinion for calculating the correlation between binary vectors?
for example, if I have two binary vectors X1 and X2 generating by a uniform distribution, as follows:
X1=(1 0 0 1 1 1 0 )
X2=(1 0 1 1 1 0 1 )
Since they have the same bits in the exact 4 position of this 7 bits, can we say the correlation between these two vectors is 4/7?
Thanks
 A: No. If I toss some coins, I would have $X_1 = \text{(1 if head, 0 if tail)}$ and $X_2 = (\text{1 if tail, 0 if head})$. Your method would say $\text{Cor}(X_1,X_2) = 0$ because they never match, but we know one predicts the other perfectly by being its opposite, so the correlation should be $-1$.
You want to use
$$\text{Cor}(X_1,X_2) = {\text{# matches} - \text{# mismatches} \over \text{# comparisons}}$$
A: Avoid the term "correlation" for anything that does not have the expected value 0 for independent data, and a range of -1 to +1.
When people read correlation, they'll expect the Pearson correlation coefficient (or Spearman, which is Pearson after a rank transform).
Simple Matching Coefficient (SMC)
This coefficient is the number of bits in common (both 0 or both 1) over the total length. It's closely related to Hamming distance on bit strings. That is exactly what you have been computing, so why not use the name SMC?
Alternatively, you could also use actual Pearson Correlation, or the Jaccard index (which does not take 0s into account if both agree).
