extract_dcpo_results: Extract DCPO Results

View source: R/extract_dcpo_results.R

extract_dcpo_resultsR Documentation

Extract DCPO Results

Description

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

Usage

extract_dcpo_results(dcpo_input, dcpo_output, par)

Arguments

dcpo_input

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

dcpo_output

a DCPO object output by DCPO::dcpo or DCPOtools::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")



fsolt/DCPOtools documentation built on June 9, 2025, 4:10 p.m.