Learn R Programming

irtplay (version 1.6.2)

sx2_fit: S-X2 fit statistic

Description

This function computes \(S-X^{2}\) (Orlando & Thissen, 2000, 2003) item fit statistic.

Usage

sx2_fit(x, ...)

# S3 method for default sx2_fit(x, data, D = 1, alpha = 0.05, min.collapse = 1, norm.prior = c(0, 1), nquad = 30, weights, ...)

# S3 method for est_item sx2_fit(x, alpha = 0.05, min.collapse = 1, norm.prior = c(0, 1), nquad = 30, weights, ...)

# S3 method for est_irt sx2_fit(x, alpha = 0.05, min.collapse = 1, norm.prior = c(0, 1), nquad = 30, weights, ...)

Arguments

x

A data frame containing the item metadata (e.g., item parameters, number of categories, models ...), an object of class est_item obtained from the function est_item, or an object of class est_irt obtained from the function est_irt. See irtfit, test.info, or simdat for more details about the item metadata. The data frame of item metadata can be easily obtained using the function shape_df.

...

Further arguments passed to or from other methods.

data

A matrix containing examinees' response data for the items in the argument x. A row and column indicate the examinees and items, respectively.

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 \(\alpha\)-level of the hypothesis test for \(S-X^{2}\) fit statistic. Default is .05.

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 gen.weight. If missing, default values are used (see the arguments of norm.prior and nquad).

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 \(S-X^{2}\) fit statistics for all items.

item_df

The item metadata specified in the argument x.

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 compute \(S-X^{2}\) fit statistics for a data frame x containing the item metadata.

  • est_item: An object created by the function est_item.

  • est_irt: An object created by the function est_irt.

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.

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, test.info, simdat, shape_df, est_item

Examples

Run this code
# NOT RUN {
## import the "-prm.txt" output file from flexMIRT
flex_sam <- system.file("extdata", "flexmirt_sample-prm.txt", package = "irtplay")

# select the first twenty dichotomous items and last polytomous item
# assuming that the test consists of twenty-one items
x <- bring.flexmirt(file=flex_sam, "par")$Group1$full_df[c(1:20, 55), ]

# 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)

# }
# NOT RUN {
# compute fit statistics
fit <- sx2_fit(x=x, data=data, nquad=30)

# fit statistics
fit$fit_stat
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab