summarize_irtree_fit: Calculate summary for a fitted model.

Description Usage Arguments Details Value Examples

Description

Function takes a fitted model returned from fit_irtree and calculates summaries for all parameters using coda's summary.mcmc.list.

Usage

1
summarize_irtree_fit(fit, fitMethod = NULL, interact = FALSE, ...)

Arguments

fit

a fitted object from fit_irtree.

fitMethod

whether to use JAGS or Stan

interact

logical. If set to TRUE, the function may be prompt for input.

...

Further arguments passed to summary.mcmc.list.

Details

The difference between the present function and directly calling coda's summary.mcmc.list is that, herein, the correlations of the thetas are summarized in addition to the covariances. This is useful if fitMethod = "jags", because JAGS does only save the covariances; in Stan, the correlations are computed directly during sampling.

Value

Returns a list containing the input fit as well as an MCMC list and summary.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# generate data
N <- 20
J <- 10
betas <- cbind(rnorm(J, .5), rnorm(J, .5), rnorm(J, 1.5), rnorm(J, 0))
dat <- generate_irtree_ext(N = N, 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)
head(res2$summary$statistics)
head(res2$summary$quantiles)

## End(Not run)

hplieninger/mpt2irt documentation built on May 17, 2019, 4:54 p.m.