powered by
textmodel_wordscores implements Laver, Benoit and Garry's (2003) wordscores method for scaling of a single dimension.
textmodel_wordscores
textmodel_wordscores(x, y, scale = c("linear", "logit"), smooth = 0)
the dfm on which the model will be trained
vector of training scores associated with each document in x
x
scale on which to score the words; "linear" for classic LBG linear posterior weighted word class differences, or "logit" for log posterior differences
"linear"
"logit"
a smoothing parameter for word counts; defaults to zero for the to match the LBG (2003) method.
scale
linear or logit, according to the value of scale
linear
logit
Sw
the scores computed for each word in the training set
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
wordscores
A predict method is also available for a fitted wordscores object, see predict.textmodel_wordscores_fitted.
predict
predict.textmodel_wordscores_fitted
Fitting a textmodel_wordscores results in an object of class textmodel_wordscores_fitted containing the following slots:
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.
# NOT RUN { (ws <- textmodel_wordscores(data_dfm_lbgexample, c(seq(-1.5, 1.5, .75), NA))) predict(ws) predict(ws, rescaling = "mv") predict(ws, rescaling = "lbg") # }
Run the code above in your browser using DataLab