Chi-squared test. I think I see what you are doing with the chi-squared test.
Here are simulated data for groups A and B, with categories
labeled with numbers 1 through 6. Using R statistical software, I have selected different
theoretical probability apportionments to categories for
the two groups.
Make category counts for A and B.
p.a = c(.1,.2,.3,.2,.1,.1)
a = sample(1:6, 500, rep=T, prob=p.a)
t.a = tabulate(a); t.a
 44 100 160 90 50 56
p.b = c(.3,.2,.2,.1,.1,.1)
b = sample(1:6, 500, rep=T, prob=p.b)
t.b = tabulate(b); t.b
 141 91 100 49 59 60
Put the counts into a table:
TBL = rbind(t.a, t.b); TBL
[,1] [,2] [,3] [,4] [,5] [,6]
t.a 44 100 160 90 50 56
t.b 141 91 100 49 59 60
rowSums(TBL) # row totals
colSums(TBL) # column totals
 185 191 260 139 109 116
Chi-squared test for counts in table: This is a test of
homogeneity of distributions among categories. For my data, distributions
for groups A and B are (highly) significantly different with
a P-value very near 0.
Pearson's Chi-squared test
X-squared = 78.104, df = 5, p-value = 2.091e-15
Possible two-way ANOVA. However, I am not sure what you plan for an ANOVA.
have numerical test results for each patient?
- These test results should not have been used to decide
how the 500 patients in each group are put into categories.
- I'm assuming assignment to categories is based on some
combination of overt characteristics, such as age, gender,
symptoms, attempted treatments.
Then you could do a two-factor ANOVA with test result data.
The ANOVA table would have rows for Group (A,B), Category(1 through 6), and Error/Residual. With 500 subjects in each group,
the degrees of freedom
DF would be 1 for Group, 5 for Category,
and 993 for Error (or Residual).
Possible two-sample t test. If you have test results from patients in the two groups, then you could use a
Welch two-sample t test to see if population mean test
results differ between groups A and B.
However, you should not use nominal categorical group labels as data for a two-sample t test.