This function is a simple wrapper for fscores(model, full.scores = TRUE, full.scores.SE = TRUE, ...) that returns scores in a tidy data frame instead of a matrix. More fine-grained control can be achieved by using fscores directly.

democracy_scores(..., model, adjust_to_dichotomous = TRUE, as_prob = TRUE)

Arguments

...

democracy variables to use for the model. Can be bare column names or strings, or a dplyr::select expression.

model

a SingleGroupClass-class model produced by democracy_model. If missing, calculates a model using the selected columns.

adjust_to_dichotomous

Whether to calculate an adjusted score where the midpoint represents the average cutpoint for dichotomous scores. See the vignette for more details. Default is TRUE.

as_prob

Whether to output scores as 0-1 probability scales. See the vignette for more details. Default is TRUE.

Value

A data frame with latent variable democracy scores (the equivalent of the UDS posterior means) for all country-years in the data, with standard errors and 95 default:

Standard descriptive variables (generated by this package)

extended_country_name

The name of the country in the Gleditsch-Ward system of states, or the official name of the entity (for non-sovereign entities and states not in the Gleditsch and Ward system of states) or else a common name for disputed cases that do not have an official name (e.g., Western Sahara, Hyderabad). The Gleditsch and Ward scheme sometimes indicates the common name of the country and (in parentheses) the name of an earlier incarnation of the state: thus, they have Germany (Prussia), Russia (Soviet Union), Madagascar (Malagasy), etc. For details, see Gleditsch, Kristian S. & Michael D. Ward. 1999. "Interstate System Membership: A Revised List of the Independent States since 1816." International Interactions 25: 393-413. The list can be found at http://privatewww.essex.ac.uk/~ksg/statelist.html.

GWn

Gleditsch and Ward's numeric country code, from the Gleditsch and Ward list of independent states.

cown

The Correlates of War numeric country code, 2016 version. This differs from Gleditsch and Ward's numeric country code in a few cases. See http://www.correlatesofwar.org/data-sets/state-system-membership for the full list.

polity_ccode

The Polity IV country code, 2017 version. This differs from Gleditsch and Ward's numeric country code and COW in a few cases. See http://www.systemicpeace.org/inscrdata.html for the full list.

in_GW_system

Whether the state is "in system" (that is, is independent and sovereign), according to Gleditsch and Ward, for this particular date. Matches at the end of the year; so, for example South Vietnam 1975 is FALSE because, according to Gleditsch and Ward, the country ended on April 1975 (being absorbed by North Vietnam). It is also TRUE for dates beyond 2012 for countries that did not end by then, depsite the fact that the Gleditsch and Ward list has not been updated since.

year

The calendar year. Democracy measurements conventionally reflect the situation in the country as of the last day of the year.

UDS measures for comparison purposes

uds_2010_mean, uds_2011_mean, uds_2014_mean

The UDS means for the 2010, 2011, and 2014 releases, for comparison purposes

.

Latent variable scores

z1

Raw latent variable score for the model, with mean (approximately) 0 and sd (approximately) 1.

se_z1

Standard errors of raw score.

z1_pct975, z1_pct025

95 percent onfidence intervals.

z1_adj

Latent variable score for the model, adjusted to match the cutpoint for the dichotomous indexes included in the model.

z1_adj_pct975, z1_adj_pct025

95 percent confidence intervals of the adjusted score.

z1_as_prob, z1_adj_as_prob

Latent variable scores for the model, unadjusted and adjusted, converted to 0-1 probability index (0 = lowest probability of dmeocracy, 1 = highest probability).

z1_pct975_as_prob, z1_pct025_as_prob, z1_adj_pct975_as_prob, z1_adj_pct025_as_prob

95 percent onfidence intervals of the probability score.

Examples

# Replicate the official UDS scores (2011 release) democracy_scores(dplyr::matches("pmm"), verbose = FALSE)
#> # A tibble: 9,137 x 22 #> extended_country_~ year GWn cown polity_ccode in_GW_system uds_2010_mean #> <chr> <dbl> <dbl> <int> <dbl> <lgl> <dbl> #> 1 Afghanistan 1946 700 700 180 T -1.84 #> 2 Afghanistan 1947 700 700 180 T -1.84 #> 3 Afghanistan 1948 700 700 180 T -1.54 #> 4 Afghanistan 1949 700 700 180 T -1.53 #> 5 Afghanistan 1950 700 700 180 T -1.39 #> 6 Afghanistan 1951 700 700 180 T -1.52 #> 7 Afghanistan 1952 700 700 180 T -1.52 #> 8 Afghanistan 1953 700 700 180 T -1.51 #> 9 Afghanistan 1954 700 700 180 T -1.53 #> 10 Afghanistan 1955 700 700 180 T -1.39 #> # ... with 9,127 more rows, and 15 more variables: uds_2011_mean <dbl>, #> # uds_2014_mean <dbl>, z1 <dbl>, se_z1 <dbl>, z1_pct975 <dbl>, #> # z1_pct025 <dbl>, z1_adj <dbl>, z1_pct975_adj <dbl>, z1_pct025_adj <dbl>, #> # z1_as_prob <dbl>, z1_pct975_as_prob <dbl>, z1_pct025_as_prob <dbl>, #> # z1_adj_as_prob <dbl>, z1_pct975_adj_as_prob <dbl>, #> # z1_pct025_adj_as_prob <dbl>