extract_consensus {intervalpsych} | R Documentation |
Extract consensus intervals from ICM Stan Fit Object
Description
This function extracts parameter estimates for the consensus intervals from a
fitted Interval Consensus Model Stan fit object of class icm_stanfit
.
Usage
extract_consensus(icm_stanfit, print_summary = TRUE)
Arguments
icm_stanfit |
An object of class |
print_summary |
A logical value indicating whether to print a summary
of the extracted parameters. Default is |
Details
This function extracts parameter estimates for the consensus intervals from a
fitted Interval Consensus Model Stan fit object of class icm_stanfit
.
Value
A list containing:
df_rvar |
A data frame with extracted posterior samples in the random
variable datatype (see |
summary |
A table with posterior medians and credible intervals for the consensus intervals. |
Examples
# Create minimal example data
df_simplex <- data.frame(
x1 = c(0.3, 0.4, 0.2, 0.5),
x2 = c(0.3, 0.2, 0.4, 0.2),
x3 = c(0.4, 0.4, 0.4, 0.3)
)
id_person <- c(1, 1, 2, 2)
id_item <- c(1, 2, 1, 2)
# Fit ICM model
fit <- fit_icm(df_simplex, id_person, id_item, n_chains = 1,
iter_sampling = 100, iter_warmup = 100,
refresh = 0)
# Extract consensus intervals
consensus <- extract_consensus(fit)
[Package intervalpsych version 0.1.0 Index]