item_drift: Item drift analysis

View source: R/item_drift.R

item_driftR Documentation

Item drift analysis

Description

Conduct item difficulty drift analysis and flag items with potential drift Model currently supported are 1-3 PL, GPCM, and Rasch Testlet, and a mix of these models.

Usage

item_drift(
  theta,
  SA_dat = NULL,
  Cluster_dat = NULL,
  SA_parm = NULL,
  Cluster_parm = NULL,
  drift = 0.3,
  Alpha = 0.05,
  Dv = 1,
  n.nodes = 21,
  missing_as_incorrect = FALSE
)

Arguments

theta

a vector of examinee ability. The length of the vector should be equal to the number of examinees

SA_dat

For one examinee, a vector of response to standalone items. For more than one examinee, a matrix or dataframe of response to standalone items. One assertion per column. Column order must match row order in SA_parm. Use NA for missing responses

Cluster_dat

For one examinee, a vector of response to cluster items. For more than one examinee, a matrix or dataframe of response to cluster items. One assertion per column. Column order must match row order in Cluster_parm. Use NA for missing responses.

SA_parm

a matrix or dataframe of item parameters for standalone items, where columns are a (slope), b1, b2, ..., b_k (difficulty or step difficulty), g (guessing), ItemID, and AssertionID. Columns must follow the above order. See example_SA_parm for an example. Use ?example_SA_parm for detailed column descriptions

Cluster_parm

a matrix or dataframe of item parameters for cluster items, where columns are a (slope), b (difficulty), cluster variance, cluster position, ItemID, and AssertionID. Columns must follow the above order. See example_Cluster_parm for an example. Use ?example_Cluster_parm for detailed column descriptions

drift

a numeric scalar for the amount of item difficulty parameter drift tested

Alpha

a numeric vector for one or more nominal type I error rates for flagging aberrant responses.

Dv

scaling factor for IRT model (usually 1 or 1.7)

n.nodes

number of nodes used when integrating out the nuisance dimension

missing_as_incorrect

by default, missings (NAs) are treated as missing; if TRUE, missings are treated as incorrect

Value

a list of

  • RR = N (number of examinees) by n (number of assertions) dataframe of assertion residuals

  • LRR = N by n dataframe of the lower bound assertion residuals

  • URR = N by n dataframe of the upper bound assertion residuals
    If run for more than one examinees, returns an additional drift_output table in the list

Note

If the test does not have SA items or Cluster items, use default (NULL) for the corresponding data and parameter arguments.

Author(s)

Zhongtian Lin lzt713@gmail.com

Examples

data(example_SA_parm)
data(example_Cluster_parm)
sigma <- diag(c(1, sqrt(unique(example_Cluster_parm$cluster_var))))
mu <- rep(0, nrow(sigma))
thetas <- MASS::mvrnorm(7,mu,sigma)
thetas[,1] <- seq(-3,3,1) #overall dimension theta values
itmDat <- sim_data(thetas = thetas, SA_parm = example_SA_parm, Cluster_parm = example_Cluster_parm)
SA_dat <- itmDat[,1:20]
Cluster_dat <- itmDat[,-1:-20]
out_scoring <- list()
for (i in 1:nrow(itmDat)) {
  out_scoring[[i]] <- scoring(SA_dat[i,], Cluster_dat[i,], example_SA_parm, example_Cluster_parm, n.nodes = 11, SE=TRUE)
}
est_theta <- sapply(out_scoring, function(x) x$par)
rst <- item_drift(est_theta, SA_dat=SA_dat, Cluster_dat=Cluster_dat, SA_parm=example_SA_parm, Cluster_parm=example_Cluster_parm,
                  drift = 0.3, Alpha=0.05, Dv=1, n.nodes = 21, missing_as_incorrect = FALSE)

woshikaqia/MIRTutils documentation built on Aug. 21, 2024, 4:30 p.m.