Which words occur in my texts, and what does that say? (counting words, text analysis)
In brief
Counting words is one way to survey large amounts of text: which words are frequent, where and how does a word stand, and which words distinguish two groups of texts? The count shows where to read more closely. It does not replace reading and interpreting, because a word is not yet a meaning.
The four tools
- Word list: words with count, share and number of documents. Very frequent are function words such as "and" and "the". With a visible stop-word list they can be hidden; the list changes the result and belongs in the description of the method.
- Key word in context (KWIC): each place of a word with the words before and after. Here one sees in which sense the word is used: "the work is hard" and "the work is fun" both count as "work".
- Dictionary: a list of your own words on a topic, for example "tired*, hard". The asterisk stands for any endings and checks only the beginning of the word. Statable counts the hits; whether they express the topic you interpret. Statable supplies no ready-made dictionaries and no sentiment assessment.
- Key words (keyness): which words are relatively more frequent in group A than in group B? What is compared are shares of the respective word total, not raw counts. The measure is the log-likelihood G2 (Dunning 1993) with a p-value.
A worked example
Group A has three short statements with 21 words in total, group B two with 15 words in total (invented). "tired" (German "müde") occurs 4 times in A, 0 times in B: G2 = 4.31, p = 0.038, a hint that the word stands out for A. "the" (German "die") occurs 3 times in A and 2 times in B; the shares are almost equal at about 14% and 13%, G2 = 0.006. Although the raw count is higher in A, "the" is not typical for A, because A is longer.
How to do it in Statable
- In the coding workspace (Ctrl+K: "count words") open the section "Analysis" and the view "Which words occur?". Choose documents; the word list appears at once.
- Look at the stop words and change them if need be, set minimum length and minimum count. With "As CSV" you save the table.
- Enter a word in "Key word in context" and read the places. In the dictionary write a line "Name: word, word*".
- For "Key words" choose documents of group A and of group B and look at the table of G2 values; then read the hits in context.
Limits
- Statable recognises no word stems: "Arbeit" and "Arbeiten" are two words; the asterisk in the dictionary helps. There is no sentiment assessment and no supplied dictionaries.
- The p-value for "Key words" is computed without correction for many tests. With long word lists single words stand out by chance; very rare words (under 5 occurrences) are hidden. A hit is a hint to read on, not a proof.
- Settings and dictionary stay only in the view and are not saved in the project. Everything is computed in the browser.
What is often misunderstood
Sources
Dunning, T. (1993). Accurate methods for the statistics of surprise and coincidence. Computational Linguistics, 19, 61-74. Luhn, H. P. (1960). Key word-in-context index for technical literature (KWIC index). American Documentation, 11, 288-295. Krippendorff, K. (2019). Content Analysis: An Introduction to Its Methodology (4th ed.), ch. 3 and 6. Sage.
Take away
- A count shows where to read; it interprets nothing.
- Stop words hide function words; the list is visible and belongs in the description of the method.
- Key words compare shares, not raw counts; the p-value is a hint without multiple-test correction.
- The asterisk in the dictionary checks the beginning of the word; read the hits in context.