plot_irtree: Plot item parameters of an mpt2irt model.

Description Usage Arguments Examples

Description

This function takes the output from a fitted model and plots the item parameters. More precisely, the probability to pass an item's threshold Φ(0-β) for an average person with θ=0 is depicted as a function of the cognitive process involved (i.e., MRS, ERS, ARS, target trait) and both traitItem and revItem.

Usage

1
2
3
plot_irtree(fit, fitModel = NULL, revItem = NULL, traitItem = NULL,
  return_data = FALSE, tt_names = NULL, measure = c("Median",
  "Mean"), rs_names = NULL)

Arguments

fit

a fitted object from fit_irtree or preferably from tidyup_irtree_fit. person) or a numeric value specifying the trait value used to plot response styles (e.g., trait=0 for an average person)

fitModel

Character. Either "2012" (Boeckenholt Model without acquiescence) or "ext" (Acquiescence Model). Details about all implemented models are described in the section Models below.

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)

return_data

Logical indicating whether the data frame used for plotting should be returned.

tt_names

Optional character vector with the name(s) of the target trait(s).

measure

Character vector that indicates whether the mean (default) or the median of the posterior distribution should be plotted.

rs_names

Character vector. Names of the MPT parameters used for plotting, defaults to something like c("m", "e", "a", "t").

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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)
plot_irtree(res1)

## End(Not run)

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