diagnostic {lsirm12pl}R Documentation

Diagnostic the result of LSIRM model

Description

diagnostic is used to diagnostic the result of LSIRM model.

Usage

diagnostic(
  object,
  plot = TRUE,
  draw.item = list(beta = "first", theta = "first", alpha = "second"),
  which.draw = c("beta", "gamma")
)

Arguments

object

object of class lsirm.

plot

If TRUE, MCMC diagnostic plots are returned

draw.item

Select items for diagnosis. A default "first" is drawing the first item for selected parameters in which.draw. Parameter "alpha", however, uses "second" as a default value because the first alpha has an estimation issue. Positions and item names are supported. For instance, if the name of item is "i1", "i2", "i3" and its positions is in order, the result of beta = c("i1","i2","i3") and beta = c(1,2,3) are equivalent.

which.draw

Select parameters for diagnosis. For the 1PL model, "beta", "theta" and "gamma" are available. "alpha" is only available in the 2PL model.

Value

diagnostic returns plots for checking MCMC convergence for selected parameters.

Examples


# generate example item response matrix
data     <- matrix(rbinom(500, size = 1, prob = 0.5), ncol=10, nrow=50)
lsirm_result <- lsirm(data ~ lsirm1pl(spikenslab = FALSE, fixed_gamma = FALSE))

# 1PL model
diagnostic(lsirm_result, plot=TRUE,
           which.draw=c("beta","theta","gamma"))

# 1PL model, multiple items
diagnostic(lsirm_result, plot=TRUE, draw.item=list(beta = c(1,2,3)),
           which.draw=c("beta", "gamma"))

lsirm_result <- lsirm(data ~ lsirm2pl(spikenslab = FALSE, fixed_gamma = FALSE))

# 2PL model
diagnostic(lsirm_result, plot=TRUE,
           which.draw=c("beta", "theta", "alpha", "gamma"))


[Package lsirm12pl version 1.3.1 Index]