I have a dataset of about 800k subjects and within that dataset 7025 subjects have either disease A or disease B. I'd like to test the hypothesis (chi squared test) that subjects with disease A are less likely to get disease B. Is it valid to use only subjects with at least one of the diseases as a sample? i.e only choose subjects with disease A, disease B or both diseases.
Below is a 2x2 table of the sample with only subjects that have at least one disease. There are 1000 subjects with only disease A, 6000 subjects with only disease B and 25 subjects with both.