Description Usage Arguments Value Examples
This function summarizes posterior predicted responses (1, ..., 5) for every
item and category. For a single iteration/replication, this results in a
response distribution (barplot); across multiple iterations, quantiles (using
probs
) are calculated. These quantiles should overlap the observed
frequencies.
1 | ppc_resp_irtree(ppc = NULL, probs = NULL)
|
ppc |
List. Output from |
probs |
Numeric. Vector of probabilities (passed to
|
Returns a data frame containing the specified quantiles of the posterior predictive distribution for every category of every item.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
J <- 10
betas <- cbind(rnorm(J, .5), rnorm(J, .5), rnorm(J, 1.5), rnorm(J, 0))
dat <- generate_irtree_ext(N = 20, J = J, betas = betas, beta_ARS_extreme = .5)
# fit model
res1 <- fit_irtree(dat$X, revItem = dat$revItem, M = 200)
res2 <- summarize_irtree_fit(res1)
# posterior predictive checking
res3 <- post_prob_irtree(res2)
res4 <- ppc_irtree(prob = res3, statistics = "resp", fit = res1)
res5 <- ppc_resp_irtree(res4)
library(ggplot2)
ggplot(res5, aes(x = Categ, y = Obs, ymin = q16, ymax = q84)) +
geom_col() +
geom_errorbar() +
geom_point(aes(y = q50)) +
facet_wrap(~ Item)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.