person_fit | R Documentation |
Calculates person fit statistics. Models currently supported are 1-3 PL, GPCM, Rasch Testlet, and a mix of these models.
For traditional test (i.e., standalone items only), this is lz* described in Snijders (2001).
For Cluster items, this is lzt* described in Lin et.al (2024), which extends the lz* to the Rasch testlet model when theta is estimated by MMLE, .
person_fit(
theta,
SA_dat = NULL,
Cluster_dat = NULL,
SA_parm = NULL,
Cluster_parm = NULL,
Dv = 1,
Alpha = 0.05,
n.nodes = 21
)
theta |
a scalar or a vector of examinee ability |
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 |
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 |
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 |
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 |
Dv |
scaling factor for IRT model (usually 1 or 1.7) |
Alpha |
a numeric vector for one or more nominal type I error rates for flagging aberrant responses.
For example, |
n.nodes |
number of nodes used when integrating out the nuisance dimension |
a one-row dataframe with the following columns:
theta
: theta score user supplied
raw
: raw score
ll
: observed data loglikelihood based on MMLE
exp_ll
: expected value of the data loglikelihood
var_ll_org
: variance of the data loglikelihood before correction
correction
: correction of the variance of the data loglikelihood
var_ll
: variance of the data loglikelihood after correction
lz
: lz* or lzt* person fit index
flag_[Alpha]
: one or more columns of flags for aberrant responses based on lz and the
type I error rates specified in Alpha
This function should be run for one examinee at a time. Use parallel processing for higher processing speed.
If the test does not have SA items or Cluster items, use default (NULL) for the corresponding data and parameter arguments
If one prefer, Rasch SA items can be treated as clusters. To do so, store SA item parameters in the Cluster_parm
argument with 0 variances, and store all examinee responses in Cluster_dat
Zhongtian Lin lzt713@gmail.com
Snijders, T. A. (2001). Asymptotic null distribution of person fit statistics with estimated person parameter.
Psychometrika, 66(3), 331-342.
Lin, Z., Jiang, T., Rijmen, F. et al. (2024). Asymptotically Correct Person Fit z-Statistics For the Rasch Testlet Model.
Psychometrika, https://doi.org/10.1007/s11336-024-09997-y.
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]
# Scoring for the first examinee
out_scoring <- scoring(SA_dat[1,], Cluster_dat[1,], example_SA_parm, example_Cluster_parm, n.nodes = 11, SE=TRUE)
est_theta <- out_scoring$par
# person fit for the first examinee
rst <- person_fit(est_theta, SA_dat[1,], Cluster_dat[1,], example_SA_parm, example_Cluster_parm, Alpha=c(0.01,0.05))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.