How to test non-mutually exclusive categorical data (with groups)?

I have a dataset which looks as follows:

Patient ID Group Disease 1 Disease 2 Disease 3
01 A 0 1 0
02 B 1 1 0
03 B 1 1 0
04 A 1 1 0
... ... ... ... ...

As you can see, I have two groups A and B, with $$n_A$$ and $$n_B$$ patients respectively. Each patient can have one or more of the listed diseases, with a total number of diseases >2. Since a patient can have more than one disease, they are of course non-mutually exclusive.

The corresponding contingency table would look as below:

Group Disease 1 Disease 2 Disease 3
A 231 78 20
B 312 123 16

What type of omnibus statistical test would you use to check if there is some type of dependency between belonging to a group (A or B) and having a certain disease?

Initially, I thought about using a chi-squared test of independence, but one of the assumptions of this test is that variables must be mutually exclusive. Then, I thought about using a Cochran Q-test (which accepts non-mutually exclusive data), but my data is not paired and I don't know if it can be used with just 2 groups. So, now, I am a bit lost.

The second table you give as an example does not contain any information about not having a given disease, so you'd be throwing away useful information.

You say:

What type of omnibus statistical test would you use to check if there is some type of dependency between belonging to a group (A or B) and having a certain disease?

So I assume you're not interested in finding relationships between diseases, but just between the variable "group" and each disease taken individually. In this case, a possible approach is simply to consider that there are three distinct contingency tables you're interested in: group vs. disease A, group vs. disease B, group vs. disease C. For instance, for disease A:

Disease A No disease A
Group A 231 15258
Group B 312 15177

Once you constructed those three contingency tables, you can conduct individual tests on each of them.

If you're interested in the question "Is the variable group related to having any disease?", you'd have to create a new variable "having any disease", and use a contingency table structured like that:

Disease No disease
Group A 329 15160
Group B 451 15038

Finally, if you want to incorporate information about multiple diseases in your model (e.g. "Does belonging to group A increase the risk of having disease A, if we control for the presence of other diseases?", or "Does belonging to group A increase the risk of having an additional disease, compared to group B"?), there are other possible options (e.g. logistic regression), but you have to tell us more about your study to get more appropriate advice because this is not entirely clear from your question.

• Several points: 1) Regarding your question, yes, I am not interested in finding relationships between diseases; I just want to check the independence between belonging to a group and having a disease. 2) I get your point about treating diseases by individual tests (considering Bonferroni). But, is there any omnibus test to treat them together at once? 3) How would you use a logistic regression? what additional information do you need? Basically, what I want to proof is that belonging to a group is independentent of having any of the diseases. This is just a preliminary step in the study.
– LevG
Commented Jan 23 at 10:23
• @LeviG. As for your point (2), there is something unclear to me: you want a single result ("to test them together at once"), but at the same time you say you want to test the diseases individually. What kind of result do you expect from an omnibus test, if the variable "group" is related to disease A, but not to disease B? Do you want the test to tell "yes, there's an effect" or "no, there's no effect"? As for your point (3), correctly specifying a model depends on the question(s) you want to answer. I was mentioning it in case you had additional questions you did not mention initially. Commented Jan 23 at 10:41
• (cont'd) For the third point, the fact you want to test everything at once may hint to some additional underlying question you have about your dataset, and that might be addressed by a logistic regression (or other methods). But the difficulty here is to find or articulate what is this underlying question you have about your data. On the other hand, if you're sure that you just want to test the variable "group" against each disease individually (and nothing else), then conducting tests on the 3 contingency tables is an appropriate way to go. Commented Jan 23 at 10:49
• Let me clarify (2). What I want is something on the line of: "No, the variable group is independent of all diseases, meaning that belonging to a group does not increase the probability of having any disease in particular". That's the type of omnibus test I am looking for. But I guess you are trying to convey that these are actually independent tests, and I should treat them as such. Correct?
– LevG
Commented Jan 23 at 10:51
• The problem with the approach you suggest ("Having/Not Having a disease"), is that it would be blind to effects on a more granular level. For example: if Group A were related to having Disease 2 (higher incidence than in Group B), this test you suggest wouldn't be able to spot it. So I guess the distinct tests approach is the way to go; I'll do that. Thanks a lot for your help!
– LevG
Commented Jan 23 at 11:10