KH Coder Tutorial using Anne of Green Gables:

A Two-Step Approach to Quantitative Content Analysis
Koichi Higuchi

1Introduction

2

Introduction

Preface This presentation is a tutorial on how to use KH Coder.
 KH Coder is a free software for quantitative content analysis ortext mining. It is also utilized for computational linguistics.
 Details and downloads: http://khcoder.net/en3

Table of Contents
Introduction
 Data Purpose of Analysis
Preparation
 Install KH Coder Configure Stopwords
 Create a Project and Run Pre-Processing
Step 1
 Word Frequency List The Context where a word is used
 Co-occurrence Network of Words
 Correspondence Analysis of Words
 Closing Remarks for Step 14Step 2
 Use Coding Rules to Count Concepts
 Retrieve Documents Assigned a Specific Code Characters in Each Chapter
 Characters and Verbs
 Change of Words Co-occurring with Marilla Conclusions

Introduction

Introduction

Data

We are going to analyze a novel Anne of Green Gables by Montgomery.
When you prepare your own data for analysis, please open the attached“Anne.xls” file in “tutorial_en” folder and see the figure below.
(1) Enter column names in the first row(2) Enter actual data in the second and subsequent rows(*) Enter data in the first sheet if you use Excel or Calc5

Purpose of Analysis

Introduction

To confirm whether the quantitative analysis canalso illustrate the centrality of Marilla It has been pointed out that the heroine Anne’s foster mother Marillaplays an essential role in the novel and that Marilla is more central
than Anne's best friend Diana, and Gilbert with whom Anne has afaint romance.

To demonstrate a quantitative content analysis
approach that comprises the following two steps:

6 [Step 1] Extract words automatically from data and statisticallyanalyze them to obtain a whole picture and explore the features ofthe data while avoiding the prejudices of the researcher.
 [Step 2] Specify coding rules, such as "if there is a particularexpression, we regard it as an appearance of the concept A", andextract concepts from the data. Then, statistically analyze theconcepts to deepen the analysis.

Preparation

7

Install KH Coder(1) Run the installer

8

Preparation

Preparation

Interface Language(1) Double click the shortcut on
your desktop to start KH CoderWe call this a “menu”.

In case the menu is not displayed in yourfavorite language, please select it here

Interface translation is not completed.
If you find a typo or if you have a suggestion, post it here:
https://github.com/ko-ichi-h/khcoder/discussions
9

Preparation

Configure Stopwords(1) Go to [Project] [Settings] in the menu of KH Coder(2) Click(3) Open the “tutorial_en”
folder, drag the file“stopwords_sample.txt”
and drop here.
(Alternatively, simply paste
the content of the file here.)(4) Click

Black balloons indicate
operations you have toperform.
10Notes on Stopwords

Preparation

You can specify any words as stopwords in KH Coder to exclude
those words from your analysis.
Stopwords will be given the special POS tag “OTHER”.

“OTHER” is NOT checked by default, so that words
with “OTHER” tag will be excluded from analyses.

Green balloons andbare texts are notes.
No operation needed.
11

Preparation

Create a Project & Run Pre-Processing(1) Go to [Project] [New] in the menu of KH Coder(2) Click [Browse] and open “anne.xls” in the “tutorial_en” folder(3) Make sure [text] and [English] areselected(4) Click(5) Go to [Pre-Processing] [Run Pre-Processing] in the menu and click [OK]12

Next time you start KH Coder, go to [Project] [Open] in themenu and open the project you have created here.
KH Coder “concentrates” on the task. So it may look frozen
or “not responding”. But it’s normal when it’s busy.

Step 113

Word Frequency List (1/2)

Step 1(1) Go to [Tools] [Words] [Frequency List] in the menu

These numbers are counts ofbase forms / lemma(2) Click to export to Excel
14Step 1

Word Frequency List (2/2)
Words

15

Freq

Words

Freq

ANNE

1138

little283

want

149

say952girl

267

home136MARILLA

849

thing

260

child

134

think

486

tell

252

Barry

132

Diana

414

look

246

school

128

know

364

good

225

sit

126

Matthew

361

feel

215

night

117

just

358

time

208

really

116

come

353

eye

152

hair

114

make286

Lynde

151

Gilbert

113

Words

Freq

The character name that most frequently appears next to the heroine“ANNE” is not her best friend “Diana” but “MARILLA”.
In the novel, an orphan “girl” or “child” heroine gets adopted, finds a“home”, and goes to “school”. And she once had a inferiority complexabout her “hair”.

The Context Where a Word is Used
(1) Go to [Tools] [Words] [KWIC Concordance] in the menu
(2) Type a word and hit the [Enter] key(3) Double click a line to view
the whole paragraph

16

Step 1

Co-Occurrence Network of Words (1/2)

Step 1(1) Go to [Tools] [Words] [Co-Occurrence Network] in the menu

(3) Select [Subgraph:modularity] here(2) Configure as shown inthis screen and click [OK]17Step 1

Co-Occurrence Network of Words (2/2)
boy(9)

faceeveningeye(10)GREEN

GABLES
oldgirl
littleMatthewyearday(1)timeMARILLA“Diana”, “Marilla”, andhome
goodAvonlea
hair
make“Matthew” are connectedschoolANNE
saycomethinkred (2)Gilbertclose to “Anne”
Jane
Blythewantpeople
Ruby
Diana thing
Gillis“Gilbert” is in rather remote (8)knowAndrews
tellBarry
part and connected toLyndeJosiebookreadPyelook“Anne” via “school”Rachel
Stacy
new
suppose letjust“Jane”, “Ruby”, “Josie”, andpretty
bedlifecourse
dress
Allan
woman
“Stacy” are also connected
ministernightrightbigfeel(3)(7)
away
via “school”
suretea
man
way
live
real
believe
The figure is retouched withlikeheart
reallysit
niceIllustrator
lovelywindow
(6)

glad

white
world

18

place

imagine
try

hard

grow

imagination
worduse(5)

greatlove(4)Methods for Exploring Co-Occurrences of Words
To explore co-occurrences of words, you can also use: hierarchical cluster analysis Multi-dimensional scaling

co-occurrence network

cluster analysis

MDS

By interpreting these result, you may find major themes of the text
from groups of words which tend to appear together.

19

KH Coder uses R as back end to execute these multivariate methods.

Step 1

Correspondence Analysis of Words (1/2)

Step 1(1) Go to [Tools] [Words] [Correspondence Analysis] in the menu

(3) Select [grayscale] here

(2) Configure as shown in20

this screen and click [OK]

Step 1

Correspondence Analysis of Words (2/2)

Allan Stacy

In the beginning [01-07],
the “child” Anne wasallowed to “stay” in“Cuthbert’s house”.

In the latter half of thenovel, Anne and Diana
went separate ways,
and Anne's schoolmates,
such as “Josie”, “Jane”,
and “Ruby”, becomecharacteristic. Anne also
learned a lot from adultwomen such as Mrs.
“Allan” and Miss “Stacy”.

210.50Dimension 2 (0.07, 26.97% )Then in [08-19], she
met a neighbor girl
“Diana” and started
going to “school”. At theschool, she met“Gilbert”.

Josie0.25

JaneCuthbert
wantboyroad

01−07oldyearnightplace Matthew
child

0.00

Rachelhousebed
imagine20−28

imagination
little−0.5

minister29−38
evening
GillisnewRubyPyeheart
ANNE
room−1.0life

MARILLA

08−19
−0.50

hair

stay−0.25

walk

Barryschool

0.0
Dimension 1 (0.1417, 54.59% )GilbertBlytheFrequency

friend900
600300Diana
0.5

We can understand the story flow throughout the novelby checking characteristic words of each part.

Characteristic Words of each Part

Step 1(1) Go to [Tools] [Variables & Headings] in the menu

(2) Click “part”(3) Select “Sentences”(4) Select “catalogue: Excel”

Top 10 characteristic wordsof each part are tabulated. It
can be used as an alternative
for correspondence analysis.

Closing Remarks for Step 1

Step 1

Statistical analyses of automatically extracted words
are suitable for gaining a whole picture of the data
 Main theme (word frequency list or co-occurrence network) Relations between characters or words (co-occurrence network) Story flow (correspondence analysis)

About the centrality of Marilla Most frequently appears next to the heroine Anne
 Her relationship with Anne appears to be almost as strong as Diana’s Be present throughout all four parts of the story
We obtained overviews of entire data in this step. Next, weare going to put more focus on Marilla using coding rules.

23

Step 224

Use Coding Rules to Count Concepts

Step 2

In some cases, we have to count concepts, not words.
To count concepts, you can compose “cording rules” like this:Indicates the name of this code: “Character_name_Gilbert”*Character_name_Gilbert
Gilbert or Gil
Not only the documents containing “Gilbert” butalso those containing “Gil” are assigned this code.
If a document is acceptable under multiple coding rules, multiple
codes will be assigned to the document.

25

Retrieve Documents Assigned a Specific Code(1) Go to [Tools] [Documents] [Search Documents] in the menu
(2) Click [Browse] and open “code_1.txt” in the “tutorial-en” folder(3) Double click any of the codes(4) Double click a line to view
the whole paragraph

26

Step 2

Step 2

Characters in Each Chapter (1/2)(1) Go to [Tools] [Coding] [Crosstab] in the menu
(2) Click [Browse] and open “code_1.txt” in the “tutorial_en” folder(3) Select [Sentences]and [chapter](5) Click27(4) ClickCharacters in Each Chapter (2/2)

Step 2

Pearson rsd.

ANNE

5.0
2.5

Marilla0.0−2.5

Matthew

−5.0

Diana

Percent:
10
20

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
1920
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

GilbertMarilla and Anne are present almost everywhere
Although Marilla and Anne were apart in chapter 35, there was anemotional reunion in the following chapter 36. Anne won a scholarshipand rejoiced saying “Oh, won’t Matthew and Marilla be pleased!”28

Characters and Verbs (1/2)(1) Go to [Tools] [Coding] [Co-occurrences Network] in the menu
(2) Click [Browse] and open “code_2.txt” in the tutorial folder(3) Configure as shown inthis screen and Click [OK]29

Step 2

Step 2

Characters and Verbs (2/2)
Diana

Anne often expresses what she“feels” to Marilla:
 “I do feel dreadfully sad,Marilla” (c21)

Marilla and Anne often “look”
at each other: Marilla looked at Anne andsoftened at sight of the child’s
pale face… (c6)
 Anne looked at her with eyes
limpid with sympathy (c20) Marilla looked at her with atenderness that would never
have been suffered to reveal
itself in any clearer light… (c30)30Gilbert

.04
.06

.04

think
.05

ANNE

.06

.03
.04

.11

lookknow

.03

.04

.05
.05

.06

MarillaMatthew

.03
.04

.04

.03

tellfeel

Marilla and Anne exchange their feelings by words, and also with their eyes,
meaning that a close and intimate relationship is depicted between the two.

Step 2

Change of Words Co-occurring with Marilla (1/3)(1) Go to [Tools] [Words] [Word Association] in the menu
(3) Click [*Marilla](4) Hold down [Ctrl]
key on the keyboard(2) Click [Browse] and open “code_3.txt”(5) Clickand click [*01-07]

31* To search the words co-occurringwith Marilla in the following part "0819", repeat procedure (3) and thenclick [*08-19] instead of [*01-07] inprocedure (4).

Step 2

Change of Words Co-occurring with Marilla (2/3)“Marilla really did not know how to talk to the child, andher uncomfortable ignorance made her crisp and...” (c4)01-07Matthew.053
mare.040
Cuthbert.040
table.038
dish.037
child.033
bed.032
say.032
uncomfortable .032
sorrel.032

08-19
say.072
ANNE .059
just.039
think .036
brooch .031
tell.030
evening.025
home .024
set.024
let.023The “feel” and “look”
20-28
say.042think .034
ANNE .032
cake.030
make .028
minister .028
Allan .026
feel.025
know .024
time.023

The “child” is upgraded to “Anne” and implying that it isimpossible to bring up a child without “saying” anything.

32

29-38
Matthew .041
look.040
sit.039
ANNE.038
say.038
face.031
girl.026
think.024
want.022
lean.022

Step 2

Change of Words Co-occurring with Marilla (3/3)
Change of Marilla
1. Uncomfortable ignorance [01-07]

2. Calling Anne and Saying many things [08-28]
3. Exchanging feelings by words and eyeswith Anne [20-38]
The change is depicted throughout the story.
33

Conclusions

Step 2

Results of step 2 showed that: Marilla is literally present almost everywhere A close and intimate relationship is depicted between
Marilla and Anne
 Change of Marilla and growing relationship between
Marilla and Anne is depicted throughout the story
Our analysis supports the assertion that Marilla plays central
roll in the story.
Identifying keywords like “child”, “uncomfortable”, “look”, and“feel” through quantitative analysis is considered to be usefulfor extracting depiction which specifically describes Marilla’s
roll and change in the story.
34

Web site of KH Coder
http://khcoder.net/en

For more details on this tutorial

Part 1: http://www.ritsumei.ac.jp/file.jsp?id=325881
Part 2: http://www.ritsumei.ac.jp/file.jsp?id=346128

Questions or Comments?

https://github.com/ko-ichi-h/khcoder/discussions