How can I generate a correlation matrix of different categories in the same column? I am working with medical data in which I have a column with different categories of diseases assigned to different patients. For eg,
patient disease
1 101 A
2 101 B
3 102 A
4 102 C
5 102 B
6 103 A
7 104 B
8 104 C
I want to find the correlation between the different diseases A, B, and C to find out if a patient has disease A, how likely they will have disease B, and so on for every pair.
Something like this,
A B C
A ... ... ...
B ... ... ...
C ... ... ...