Description Usage Arguments Details Value Models Note on Output Examples
This function fits an mpt2irt model. Either the so-called Boeckenholt Model
can be fit (fitModel = "2012"
) that assumes the three processes MRS,
ERS, and target trait; or the so-called Acquiescence Model can be fit that
additionally takes ARS into account (fitModel = "ext"
).
1 2 3 4 5 6 | fit_irtree(X, revItem = NULL, traitItem = rep(1, ncol(X)), df = NULL,
V = NULL, fitModel = c("ext", "2012", "pcm", "steps", "shift",
"ext2"), model = NULL, fitMethod = c("stan", "jags"),
outFormat = NULL, startSmall = FALSE, M = 1000, warmup = 1000,
n.chains = 2, thin = 1, method = "parallel", add2varlist = NULL,
cores = NULL, summarise = FALSE, N2 = 2, ...)
|
X |
an N x J matrix of observed responses for categories 1...5 (use
|
revItem |
vector of length J specifying reversed items (1=reversed, 0=regular) |
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) |
df |
degrees of freedom for wishart prior on covariance of traits (default: number of processes + 1) |
V |
prior for wishart distribution (default: diagonal matrix) |
fitModel |
Character. Either |
model |
If |
fitMethod |
whether to use JAGS or Stan |
outFormat |
either "mcmc.list" (can be analyzed with coda package) or "stan" or "runjags" |
startSmall |
Whether to use random starting values for beta sampled from "wide" (FALSE) or "narrow" priors (TRUE; beta and theta closer to 0; might solve problems with slow convergence of some chains for extreme starting values). |
M |
number of MCMC samples (after warmup) |
warmup |
number of samples for warmup (in JAGS: 1/5 for adaptation, 4/5 for burnin) |
n.chains |
number of MCMC chains (and number of CPUs used) |
thin |
thinning of MCMC samples |
method |
Passed to |
add2varlist |
Additional variables to monitor (e.g., |
cores |
Passed to |
summarise |
Passed to |
N2 |
Numeric. Number of persons for whom to draw posterior predictives.
Specify equal to |
... |
further arguments passed to |
Note that DIC can only be saved using fitMethod = "jags"
in
combination with method = "simple"
. Furthermore, you need to
explicitly request DIC using, for example, add2varlist = c("deviance",
"pd", "popt", "dic")
.
Returns a list where the output from either JAGS or Stan is stored in
the entry samples
.
The following models are currently implemented:
2012
This is the response style model proposed by Boeckenholt (2012) with parameters m (MRS), e (ERS), and t (target trait).
ext
This is the Acquiescence Model proposed by Plieninger and Heck (2018) with parameters m (MRS), e (ERS), a (ARS), and t (target trait). The e* parameter is constrained, namely, all item parameters are constrained to be equal.
steps
This is an ordinal IRT model without response styles as proposed by Tutz (1990) and Verhelst et al. (1997). It is also based on a tree structure but has only the parameter t (target trait).
pcm
This is an ordinal IRT model without response styles, namely, the partial credit model, which has only the parameter t (target trait).
shift
This is the tree-shift model proposed by Plieninger and
Heck (2018) in Appendix A with parameters m (MRS), e (ERS), and ta (target
trait and ARS). For regular items, ta = t + a, whereas for reversed items,
ta = -t + a. Unlike the Acquiescence Model (ext
), this model is not
a mixture model.
ext2
This is the unrestricted version of the Acquiescence Model. Therein, fewer constraints are imposed on the e* parameter, and all its item parameters are free to vary.
In the output, the estimated parameters are always arranged in the order MRS,
ERS, ARS, target trait(s). For example, a 2012
-model with two target
traits (specified via traitItem
), has four person parameters and MRS
is the first, ERS the second, and the two target traits the third and fourth.
Furthermore, only one subscript and column is used for each type of item
parameter. That is, all β_t (i.e., target-trait difficulites) are stored
in one column and traitItem
indicates which parameter pertains to
which target trait.
This is illustrated for two models in the following:
Model 2012
(S = 2 + number of traits):
theta[i, 1:S] = c(MRS, ERS, target trait(s))
beta[j, 1:3] = c(MRS, ERS, target trait)
Model ext
(S = 3 + number of traits):
theta[i, 1:S] = c(MRS, ERS, ARS, target trait(s))
beta[j, 1:4] = c(MRS, ERS, ARS, target trait)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
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)
res3 <- tidyup_irtree_fit(res2)
names(res3)
res3$plot
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.