I'm using scipy and I'd like to calculate the chi-squared value of a contingency table of percentages.
This is my table, it's of relapse rates. I'd like to know if there are values that are unexpected, i.e. groups where relapse rates are particularly high:
18-25 25-34 35-44 ...
Men 37% 36% 64% ...
Women 24% 25% 32% ...
The underlying data looks like this:
18-25 25-34 35-44 ...
Men 667 of 1802 759 of 2108 1073 of 1677 ...
Should I just use the raw values, so have a contingency table like this, and run a chi-squared test on the raw values?
18-25 25-34 35-44 ...
Men 667 759 1073 ...
That doesn't seem quite right, because it doesn't capture the relative underlying size of each group.
I have been Googling, but haven't been able to find an explanation I understand of what I should do. How should I find unexpected values in data like this?