Takes List Experiment model output (result of list_model())
and calculates summary for particular model parameters.
Arguments
- model
Output of
list_model().
Value
List with 3 elements:
betainterceptrespondents
Each element contains a data.frame with summary for coefficients/intercepts.
Examples
if (FALSE) { # \dontrun{
library("dplyr")
data("list_experiment_toy")
# We select 3 categorical variables as demographic breaks and one artificial
# numeric variable just for the purpose of demonstration.
demo_toy <- list_experiment_toy %>%
select("response_id", "d_party", "s_gender", "s_region") %>%
mutate(num_var = rnorm(nrow(.), 3, 0.4))
# We can run read %>% assert %>% tidy in pipe
le_tidy_data_toy <- list_read_data(list_experiment_toy, "response_id") %>%
list_assert_data(demo_toy, id = "response_id", n_items = 4L) %>%
list_tidy_data(id = response_id)
# We use output of tidy data as list_model input, and additionally add some
# rstan::sampling arguments to save time on execution
model_output <- list_model(
le_tidy_data_toy, iter = 400, cores = 2, chains = 2
)
# Now we can use both model and tidy data to calculate summary statistics
model_summary <- list_summary_stats(model_output)
} # }