This function is a simple wrapper for mirt::mirt that automates the process of selecting the relevant columns in the democracy dataset, preparing the data for use with mirt::mirt, and packaging the result in a form useful for democracy_scores. More fine-grained control can be achieved by using mirt directly; see the Vignette on replicating and extending the UD scores.

democracy_model(..., identifiers = c("extended_country_name", "year", "GWn",
  "cown", "polity_ccode", "uds_2010_mean", "uds_2011_mean", "uds_2014_mean",
  "in_GW_system"), verbose = TRUE, technical = list(NCYCLES = 2500))

Arguments

...

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

identifiers

Identifier columns. Can be any combination of columns in the democracy dataset. Defaults to c("extended_country_name", "year", "GWn", "cown", "polity_ccode", "uds_2010_mean", "uds_2011_mean", "uds_2014_mean").

verbose

Passed to mirt::mirt; whether to print a running commentary. Default is TRUE.

technical

Passed to mirt::mirt. Defaults to list(NCYCLES = 2500) to ensure that extende models converge.

Value

a SingleGroupClass-class model of latent democracy scores suitable for use by democracy_scores.

Examples

replication_2011_model <- democracy_model(dplyr::matches("pmm"), verbose = FALSE) replication_2011_model
#> #> Call: #> mirt::mirt(data = data %>% select(cols$measures), model = 1, #> itemtype = "graded", SE = TRUE, verbose = verbose, technical = technical) #> #> Full-information item factor analysis with 1 factor(s). #> Converged within 1e-04 tolerance after 151 EM iterations. #> mirt version: 1.26.3 #> M-step optimizer: BFGS #> EM acceleration: Ramsay #> Number of rectangular quadrature: 61 #> #> Information matrix estimated with method: Oakes #> Condition number of information matrix = 82004.52 #> Second-order test: model is a possible local maximum #> #> Log-likelihood = -55697.78 #> Estimated parameters: 94 #> AIC = 111583.6; AICc = 111585.5 #> BIC = 112252.9; SABIC = 111954.1
summary(replication_2011_model)
#> F1 h2 #> pmm_arat 0.901 0.812 #> pmm_blm 0.992 0.985 #> pmm_bollen 0.951 0.904 #> pmm_fh 0.941 0.885 #> pmm_hadenius 0.986 0.973 #> pmm_mainwaring 0.994 0.989 #> pmm_munck 0.955 0.912 #> pmm_pacl 0.967 0.936 #> pmm_polity 0.954 0.911 #> pmm_polyarchy 0.965 0.932 #> pmm_prc 0.969 0.938 #> pmm_vanhanen 0.928 0.861 #> #> SS loadings: 11.036 #> Proportion Var: 0.92 #> #> Factor correlations: #> #> F1 #> F1 1