I'm working with pandas and scipy, and I would like to find a quick way to visualise unusual values in a contingency table.
Say this is my contingency table:
wolves lions tigers chickens total ate_zebra 14112 13891 12978 54 41035 ignored_zebra 6403 6377 6109 2637 21526 total 20515 20268 19087 2691 62561
It looks as though chickens are (mostly) vegetarian, unlike the other animals.
If I run a chi-squared test, it tells me that the chi-squared value is significant and the expected values are:
wolves lions tigers chickens total 13456.19515 13294.18296 12519.54165 1765.080242 41035 7058.804846 6973.817043 6567.458353 925.9197583 21526 20515 20268 19087 2691 62561
But what I'd really like is some way to quickly, visually identify the most significant differences from the expected values, say something like this:
Excel would be good enough, but something Python-based would would be ideal :) Or do I need to write my own algorithm to do this?
Any suggestions much appreciated.