Skip to content
Prev 396623 / 398502 Next

please help generate a square correlation matrix

Let's go back to the original posting.
So we're talking about correlations between binary variables.
Suppose we have two 0-1-valued variables, x and y.
Let A <- sum(x*y)  # number of cases where x and y are both 1.
Let B <- sum(x)-a  # number of cases where x is 1 and y is 0
Let C <- sum(y)-a # number of cases where y is 1 and x is 0
Let D <- sum(!x * !y) # number of cases where x and y are both 0.

N
On Fri, 26 Jul 2024 at 12:07, Bert Gunter <bgunter.4567 at gmail.com> wrote: