textmodel_wordscores
implements Laver, Benoit and Garry's (2003)
wordscores method for scaling of a single dimension.
textmodel_wordscores(x, y, scale = c("linear", "logit"), smooth = 0)
x | the dfm on which the model will be trained |
---|---|
y | vector of training scores associated with each document
in |
scale | scale on which to score the words; |
smooth | a smoothing parameter for word counts; defaults to zero for the to match the LBG (2003) method. |
Fitting a textmodel_wordscores
results in an object of class
textmodel_wordscores_fitted
containing the following slots:
scale
linear
or logit
, according to the value of
scale
Sw
the scores computed for each word in the training set
x
the dfm on which the wordscores model was called
y
the reference scores
call
the function call that fitted the model
method
takes a value of wordscores
for this model
A predict
method is also available for a
fitted wordscores object, see
predict.textmodel_wordscores_fitted
.
Laver, Michael, Kenneth R Benoit, and John Garry. 2003. "Extracting Policy Positions From Political Texts Using Words as Data." American Political Science Review 97(02): 311-31 Beauchamp, N. 2012. "Using Text to Scale Legislatures with Uninformative Voting." New York University Mimeo. Martin, L W, and G Vanberg. 2007. "A Robust Transformation Procedure for Interpreting Political Text." Political Analysis 16(1): 93-100.
predict.textmodel_wordscores_fitted
(ws <- textmodel_wordscores(data_dfm_lbgexample, c(seq(-1.5, 1.5, .75), NA)))#> Error in get(".SigLength", envir = env): object '.SigLength' not foundpredict(ws)#> Error in predict(ws): object 'ws' not foundpredict(ws, rescaling = "mv")#> Error in predict(ws, rescaling = "mv"): object 'ws' not foundpredict(ws, rescaling = "lbg")#> Error in predict(ws, rescaling = "lbg"): object 'ws' not found