summarize_dcpo_results: Extract DCPO Results

Description Usage Arguments Value Examples

View source: R/summarize_dcpo_results.R

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

1
2
3
4
5
6
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

1
2
3
4
5
6
7
8
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")

DCPO documentation built on July 8, 2020, 7:03 p.m.