data_corpus_dailnoconf1991 | R Documentation |
Texts of speeches from a no-confidence motion debated in the Irish Dáil from 16-18 October 1991 over the future of the Fianna Fail-Progressive Democrat coalition. (See Laver and Benoit 2002 for details.)
data_corpus_dailnoconf1991
data_corpus_dailnoconf1991
is a corpus with 58 texts,
including docvars for name
, party
, and position
.
https://www.oireachtas.ie/en/debates/debate/dail/1991-10-16/10/
Laver, M. & Benoit, K.R. (2002). Locating TDs in Policy Spaces: Wordscoring Dáil Speeches. Irish Political Studies, 17(1), 59–73.
Laver, M., Benoit, K.R., & Garry, J. (2003). Estimating Policy Positions from Political Text using Words as Data. American Political Science Review, 97(2), 311–331.
## Not run:
library("quanteda")
data_dfm_dailnoconf1991 <- data_corpus_dailnoconf1991 %>%
tokens(remove_punct = TRUE) %>%
dfm()
tmod <- textmodel_affinity(data_dfm_dailnoconf1991,
c("Govt", "Opp", "Opp", rep(NA, 55)))
(pred <- predict(tmod))
dat <-
data.frame(party = as.character(docvars(data_corpus_dailnoconf1991, "party")),
govt = coef(pred)[, "Govt"],
position = as.character(docvars(data_corpus_dailnoconf1991, "position")))
bymedian <- with(dat, reorder(paste(party, position), govt, median))
oldpar <- par(no.readonly = TRUE)
par(mar = c(5, 6, 4, 2) + .1)
boxplot(govt ~ bymedian, data = dat,
horizontal = TRUE, las = 1,
xlab = "Degree of support for government",
ylab = "")
abline(h = 7.5, col = "red", lty = "dashed")
text(c(0.9, 0.9), c(8.5, 6.5), c("Goverment", "Opposition"))
par(oldpar)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.