formality: Formality Score

Description Usage Arguments Details Value Warning References Examples

Description

Transcript apply formality score by grouping variable(s) and optionally plot the breakdown of the model.

Usage

1
2
  formality(text.var, grouping.var = NULL,
    sort.by.formality = TRUE, digits = 2, ...)

Arguments

text.var

The text variable (or an object from pos, pos.by or formality. Passing the later three object will greatly reduce run time.

grouping.var

The grouping variables. Default NULL generates formality score for all text. Also takes a single grouping variable or a list of 1 or more grouping variables.

sort.by.formality

logical. If TRUE orders the results by formality score.

digits

The number of digits displayed.

...

Other arguments passed to pos.by.

Details

Heylighen & Dewaele(2002)'s formality score is calculated as:

F = 50(\frac{n_{f}-n_{c}}{N} + 1)

Where:

f = ≤ft \{noun, \;adjective, \;preposition, \;article\right \}

c = ≤ft \{pronoun, \;verb, \;adverb, \;interjection\right \}

N = ∑{(f \;+ \;c \;+ \;conjunctions)}

Value

A list containing at the following components:

text

The text variable

POStagged

Raw part of speech for every word of the text variable

POSprop

Part of speech proportion for every word of the text variable

POSfreq

Part of speech count for every word of the text variable

pos.by.freq

The part of speech count for every word of the text variable by grouping variable(s)

pos.by.prop

The part of speech proportion for every word of the text variable by grouping variable(s)

form.freq.by

The nine broad part of speech categories count for every word of the text variable by grouping variable(s)

form.prop.by

The nine broad part of speech categories proportion for every word of the text variable by grouping variable(s)

formality

Formality scores by grouping variable(s)

pos.reshaped

An expanded formality scores output (grouping, word.count, pos & form.class) by word

Warning

Heylighen & Dewaele(2002) state, "At present, a sample would probably need to contain a few hundred words for the measure to be minimally reliable. For single sentences, the F-value should only be computed for purposes of illustration".

References

Heylighen, F., & Dewaele, J.M. (2002). Variation in the contextuality of language: An empirical measure. Context in Context, Special issue of Foundations of Science, 7 (3), 293-340.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
with(DATA, formality(state, person))
(x1 <- with(DATA, formality(state, list(sex, adult))))
plot(x1)
plot(x1, short.names = TRUE)
data(rajPOS) #A data set consisting of a pos list object
x2 <- with(raj, formality(rajPOS, act))
plot(x2)
x3 <- with(raj, formality(rajPOS, person))
plot(x3, bar.colors="Dark2")
plot(x3, bar.colors=c("Dark2", "Set1"))
x4 <- with(raj, formality(rajPOS, list(person, act)))
plot(x4, bar.colors=c("Dark2", "Set1"))

rajDEM <- key_merge(raj, raj.demographics) #merge demographics with transcript.
x5 <- with(rajDEM, formality(rajPOS, sex))
plot(x5, bar.colors="RdBu")
x6 <- with(rajDEM, formality(rajPOS, list(fam.aff, sex)))
plot(x6, bar.colors="RdBu")
x7 <- with(rajDEM, formality(rajPOS, list(died, fam.aff)))
plot(x7, bar.colors="RdBu",  point.cex=2, point.pch = 3)
x8 <- with(rajDEM, formality(rajPOS, list(died, sex)))
plot(x8, bar.colors="RdBu",  point.cex=2, point.pch = "|")

names(x8)
colsplit2df(x8$formality)

#pass an object from pos or pos.by
ltruncdf(with(raj, formality(x8 , list(act, person))), 6, 4)

trinker/qdap2 documentation built on May 31, 2019, 9:47 p.m.