sx2_fit {irtQ} | R Documentation |
S-X2 fit statistic
Description
This function computes S-X^{2}
(Orlando & Thissen, 2000, 2003) item fit statistic.
Usage
sx2_fit(x, ...)
## Default S3 method:
sx2_fit(
x,
data,
D = 1,
alpha = 0.05,
min.collapse = 1,
norm.prior = c(0, 1),
nquad = 30,
weights,
pcm.loc = NULL,
...
)
## S3 method for class 'est_item'
sx2_fit(
x,
alpha = 0.05,
min.collapse = 1,
norm.prior = c(0, 1),
nquad = 30,
weights,
pcm.loc = NULL,
...
)
## S3 method for class 'est_irt'
sx2_fit(
x,
alpha = 0.05,
min.collapse = 1,
norm.prior = c(0, 1),
nquad = 30,
weights,
pcm.loc = NULL,
...
)
Arguments
x |
A data frame containing the item metadata (e.g., item parameters, number of categories, models ...), an object
of class |
... |
Further arguments passed to or from other methods. |
data |
A matrix containing examinees' response data for the items in the argument |
D |
A scaling factor in IRT models to make the logistic function as close as possible to the normal ogive function (if set to 1.7). Default is 1. |
alpha |
A numeric value to specify significance |
min.collapse |
An integer value to indicate the minimum frequency of cells to be collapsed. Default is 1. See below for details. |
norm.prior |
A numeric vector of two components specifying a mean and standard deviation of the normal prior distribution. These two parameters are used to obtain the gaussian quadrature points and the corresponding weights from the normal distribution. Default is c(0,1). |
nquad |
An integer value specifying the number of gaussian quadrature points from the normal prior distribution. Default is 30. |
weights |
A two-column matrix or data frame containing the quadrature points (in the first column) and the corresponding weights
(in the second column) of the latent variable prior distribution. The weights and quadrature points can be easily obtained
using the function |
pcm.loc |
A vector of integer values indicating the locations of partial credit model (PCM) items whose slope parameters are fixed to certain values. Default is NULL. |
Details
Often, very small expected frequencies in the contingency tables used to compute \chi^{2}
fit statistics could
compromise the accuracy of the \chi^{2}
approximation for their distribution (Orlando & Thissen, 2000).
To avoid this problem, Orlando and Thissen (2000) used an algorithm of collapsing adjacent test score groups to maintain
a minimum expected category frequency of 1. However, if Orlando and Thissen's cell collapsing approach is applied to polytomous data,
too much information would be lost (Kang & Chen, 2008). Thus, Kang and Chen (2008) collapsed adjacent cells of item score categories
for a specific score group to ensure a minimum expected category frequency of 1. The same collapsing strategies were applied
in the function sx2_fit
. If a minimum expected category frequency needs to be set to different number, you can specify
the minimum value in the argument min.collapse
.
Note that if "DRM" is specified for an item in the item metadata set, the item is considered as "3PLM" to compute degree of freedom of
the S-X^{2}
fit statistic.
Also, any missing responses in data
are replaced with incorrect responses (i.e., 0s).
Value
This function returns a list. Within a list, several internal objects are contained such as:
fit_stat |
A data frame containing the results of |
item_df |
The item metadata specified in the argument |
exp_freq |
A list containing the collapsed expected frequency tables for all items. |
obs_freq |
A list containing the collapsed observed frequency tables for all items. |
exp_prob |
A list containing the collapsed expected probability tables for all items. |
obs_prop |
A list containing the collapsed observed proportion tables for all items. |
Methods (by class)
-
default
: Default method to computeS-X^{2}
fit statistics for a data framex
containing the item metadata. -
est_item
: An object created by the functionest_item
. -
est_irt
: An object created by the functionest_irt
.
Author(s)
Hwanggyu Lim hglim83@gmail.com
References
Kang, T., & Chen, T. T. (2008). Performance of the generalized S-X2 item fit index for polytomous IRT models. Journal of Educational Measurement, 45(4), 391-406.
Orlando, M., & Thissen, D. (2000). Likelihood-based item-fit indices for dichotomous item response theory models. Applied Psychological Measurement, 24(1), 50-64.
Orlando, M., & Thissen, D. (2003). Further investigation of the performance of S-X2: An item fit index for use with dichotomous item response theory models. Applied Psychological Measurement, 27(4), 289-298.
See Also
irtfit
, info
, simdat
, shape_df
, est_item
Examples
## example 1: all five polytomous IRT models are GRM
## import the "-prm.txt" output file from flexMIRT
flex_sam <- system.file("extdata", "flexmirt_sample-prm.txt", package = "irtQ")
# select the item metadata
x <- bring.flexmirt(file=flex_sam, "par")$Group1$full_df
# generate examinees' abilities from N(0, 1)
set.seed(23)
score <- rnorm(500, mean=0, sd=1)
# simulate the response data
data <- simdat(x=x, theta=score, D=1)
# compute fit statistics
fit1 <- sx2_fit(x=x, data=data, nquad=30)
# fit statistics
fit1$fit_stat
## example 2: first 39th and 40th items follows GRM and 53rd, 54th, and 55th items
## follow PCM (thus, the slope parameters are fixed to 1)
# replace the model names with GPCM and
# assign 1 to the slope parameters for the 53rd, 54th, and 55th items
x[53:55, 3] <- "GPCM"
x[53:55, 4] <- 1
# generate examinees' abilities from N(0, 1)
set.seed(25)
score <- rnorm(1000, mean=0, sd=1)
# simulate the response data
data <- simdat(x=x, theta=score, D=1)
# compute fit statistics
fit2 <- sx2_fit(x=x, data=data, nquad=30, pcm.loc=53:55)
# fit statistics
fit2$fit_stat