# Score for over/under representations of a variable in sub-group

I have a corpus of book publications split into different clusters. I have information about the nationality of the authors (variable A) and the nationality of the publishing company (variable B).

In the case of variable B, publishing companies are either US-based or Euro-based (2 categories). In the case of variable A, authors are either American, European, or others (3 categories).

I want to know whether a cluster is more euro-centered or more us-centered when compared to the overall corpus (basically identify clusters in which EU/US identity is important) and plot it on two axes according to variables A and B.

A positive value on the Y-axis would mean the cluster has an over-representation of EU authors, and a negative value the opposite. Similarly, the X-axis would have a positive value when we find an over-representation of EU publishing companies and a negative value for US companies. (In the case of variable A, it means that simply comparing proportions can lead to both US and EU authors being over-represented).

For variable A, I used the log of relative ratio using the following formula:

log((share_europeans_authors_cluster/share_US_authors_cluster)/(share_europeans_authors_corpus/share_US_authors_corpus))

I used a similar formula for variable B but used 1-share given that there are only two variables.

The results are good but (1) I am not sure this is the best option (or the correct one given that some observations are both in the cluster and in the corpus), and (2) I get one cluster with a value inferior to -1 for variable A.