# Which statistical analysis is preferable to compare text count between two sites?

I'm trying to compare differences in text content between sites from medical societies from USA and UK.

My plan is to describe with wordclouds, tables and other graphs for the descriptive part.

In case of a comparison between sites, which could be an appropriate statistical analysis?

I was reading Agresti (2002), chapter 13: Other Mixture Models for Categorical Data about Latent Class Models, but I'm not sure if this would be correct.

Agresti, A., 2002. Categorical data analysis 2nd ed., New York: Wiley-Interscience.

When you have two sources of text and want to compare them, one of my favorite types of analysis is to find which words are more or less likely to come from each source using the log odds ratio.

In pseudocode, you want to find

log odds ratio =  log((n1 / total1) / (n2 / total2))


for each word. You can check out this chapter or these blog posts for how to implement it.

I will often use a base 2 logarithm (log2() in R), because then you can easily get out some nice numbers. A log odds ratio of 0 indicates words used the same from both sources, a base 2 log odds ratio of 1 indicates words used twice as much from one source, a base 2 log odds ratio of 2 indicates four times as much from one source, etc.