compute_PicaultRenault_scores: Compute scores using the Picault-Renault lexicon

View source: R/others.R

compute_PicaultRenault_scoresR Documentation

Compute scores using the Picault-Renault lexicon

Description

Computes Monetary Policy and Economic Condition scores using the Picault-Renault lexicon for central bank communication.

Usage

compute_PicaultRenault_scores(x, min_ngram = 2, return_dfm = FALSE)

Arguments

x

a quanteda::corpus object.

min_ngram

the minimum length of n-grams considered in the computation

return_dfm

if TRUE, returns the scaled word-per-document score under two dfm, on for the Monetary Policy and one for the Economic Condition categories. If FALSE, returns the sum of all word scores per document.

Details

The computation is done on a per-document basis, such as each document is scored with a value between -1 and 1. This is relevant to the computation of the denominator of the score.

It is possible to compute the score for paragraphs and sentences for a quanteda::corpus segmented using quanteda::corpus_reshape. Segmenting a corpus using quanteda's helpers retain track to which document each paragraph/sentence belong. However, in that case, it is possible that paragraphs or sentences are scored outside the (-1,1) interval. In any case, the of the paragraph/sentences scores averaged over documents will be contained in the (-1,1) interval.

Value

A matrix with two columns, indicating respectively the MP (Monetary Policy) and EC (Economic Condition) scores of each document.

References

Picault, M. & Renault, T. (2017). Words are not all created equal: A new measure of ECB communication. Journal of International Money and Finance, 79, 136–156.

See Also

PicaultRenault

Examples

# on documents
docs <- quanteda::corpus_reshape(ECB_press_conferences, "documents")
compute_PicaultRenault_scores(docs)

# on paragraphs
compute_PicaultRenault_scores(ECB_press_conferences)

sentopics documentation built on May 31, 2023, 8:26 p.m.