scale_weighted | R Documentation |
Scaling functions take a data.frame of variables with information about
political parties/text and position the cases on a scale, i.e. output a
vector of values. For applying scaling functions directly to text documents,
refer to mp_scale
.
scale_weighted(
data,
vars = grep("per((\\d{3}(_\\d)?)|\\d{4}|(uncod))$", names(data), value = TRUE),
weights = 1
)
scale_logit(data, pos, neg, N = data[, "total"], zero_offset = 0.5, ...)
scale_bipolar(data, pos, neg, ...)
scale_ratio_1(data, pos, neg, ...)
scale_ratio_2(data, pos, neg, ...)
data |
A data.frame with cases to be scaled |
vars |
variable names that should contribute to the linear combination; defaults to all CMP category percentage variables in the Manifesto Project's Main Dataset |
weights |
weights of the linear combination in the same order as 'vars'. |
pos |
variable names that should contribute to the numerator ("positively") |
neg |
variable names that should contribute to the denominator ("negatively") |
N |
vector of numbers of quasi sentences to convert percentages to counts |
zero_offset |
Constant to be added to prevent 0/0 and log(0); defaults to 0.5 (smaller than any possible non-zero count) |
... |
further parameters passed on to |
scale_weighted
scales the data as a weighted sum of the variable values
If variable names used for the definition of the scale
are not present in the data frame they are assumed to be 0.
scale_weighted
scales the data as a weighted sum of the category percentages
scale_logit
scales the data on a logit scale as described by Lowe et al. (2011).
scale_bipolar
scales the data by adding up the variable
values in pos and substracting the variable values in neg.
scale_ratio_1
scales the data taking the ratio of the difference of the sum of the variable
values in pos and the sum of the variable values in neg to the sum of the variable values in pos and neg
as suggested by Kim and Fording (1998) and by Laver & Garry (2000).
scale_ratio_2
scales the data taking the ratio of the sum of the variable
values in pos and the sum of the variable values in neg.
Lowe, W., Benoit, K., Mikhaylov, S., & Laver, M. (2011). Scaling Policy Preferences from Coded Political Texts. Legislative Studies Quarterly, 36(1), 123-155.
Kim, H., & Fording, R. C. (1998). Voter ideology in western democracies, 1946-1989. European Journal of Political Research, 33(1), 73-97.
Laver, M., & Garry, J. (2000). Estimating Policy Positions from Political Texts. American Journal of Political Science, 44(3), 619-634.
mp_scale
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.