Predict textmodel_wordscores
# S3 method for textmodel_wordscores
predict(object, newdata = NULL,
se.fit = FALSE, interval = c("none", "confidence"), level = 0.95,
rescaling = c("none", "lbg", "mv"), include_reftexts = TRUE, ...)
a fitted Wordscores textmodel
dfm on which prediction should be made
if TRUE
, return standard errors as well
type of confidence interval calculation
tolerance/confidence level for intervals
"none"
for "raw" scores; "lbg"
for LBG (2003)
rescaling; or "mv"
for the rescaling proposed by Martin and Vanberg
(2007). See References.
if FALSE
, reference texts are removed from the prediction
not used
textmodel_wordscores()
returns a list that is also classed as a
textmodel_wordscores
object, containing the following elements:
the scores computed for each word in the training set (\(S_{wd}\) from Laver, Benoit and Garry 2003)
either linear
or logit
, according to the value of scale
the dfm on which the wordscores model was called
the vector of document reference values
the function call that fitted the model
predict.textmodel_wordscores() returns a named vector of predicted document scores ("text scores" S_{vd} in LBG 2003), or a named list if se.fit = TRUE consisting of the predicted scores ($fit) and the associated standard errors ($se.fit). When interval = "confidence", the predicted values will be a matrix. This behaviour matches that of predict.lm.