summarize_dcpo_results {DCPO}R Documentation

Extract DCPO Results

Description

summarize_dcpo_results is a convenience function that produces summary statistics of the main parameters of a DCPO stanfit object along with the relevant identifying information (country, year, question, and cutpoint).

Usage

summarize_dcpo_results(
  dcpo_input,
  dcpo_output,
  pars = c("theta", "sigma", "alpha", "beta", "delta"),
  probs = c(0.1, 0.9)
)

Arguments

dcpo_input

the data frame of survey items and marginals generated by DCPOtools::dcpo_setup previously passed to DCPO::dcpo to generate the stanfit object passed as dcpo_output

dcpo_output

a stanfit object output by DCPO::dcpo

pars

a character vector of parameter names to be summarized from the DCPO model: theta (mean public opinion), sigma (polarization in public opinion), alpha (question dispersion), beta (question-cutpoint difficulty), and/or delta (country-specific question bias)

probs

a numeric vector of quantiles of interest; the default is c(.1, .9)

Value

a tibble

Examples


out1 <- dcpo(demsup_data,
             chime = FALSE,
             chains = 1,
             iter = 300) # 1 chain/300 iterations for example purposes only; use defaults

theta_results <- summarize_dcpo_results(dcpo_input = demsup_data,
                                        dcpo_output = out1,
                                        pars = "theta")



[Package DCPO version 0.5.3 Index]