Description Usage Arguments Value Examples
Function takes an MCMC list of posterior samples and calculates the
model-predicted probabilities. This can either be done for the persons in the
sample or for out-of-sample predictions for new persons (new_theta =
TRUE
).
1 2 3 |
fit_sum |
List. Output from |
mcmc.objects |
a list of MCMC or runjags objects, all with the same number of chains and matching variable names, or a single MCMC object/list or runjags object. No default. |
iter |
Numeric. Number of iterations to use, the maximum is the total
number of retained iterations (via |
N |
Numeric. Number of persons for whom posterior predictives should be
drawn. Should be equal to the number of persons in the sample if
|
traitItem |
vector of length J specifying the underlying traits (e.g., indexed from 1...5). Standard: only a single trait is measured by all items. If the Big5 are measured, might be something like c(1,1,1,2,2,2,...,5,5,5,5) |
revItem |
vector of length J specifying reversed items (1=reversed, 0=regular) |
fitModel |
Character. Either |
new_theta |
Logical. Wheter to calculate the probabilities for the
persons in the sample or for out-of-sample predictions for |
Returns an array of probabilities of dimension iter
x N
x J x 5 (for J items with 5 response categories).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## 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 probabilities
res3 <- post_prob_irtree(res2)
dim(res3)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.