Classical Item Statistics#
Motivation#
Two statistics of classical test theory screen the responses before a calibration, item by item, with no model fitted. The proportion correct, the item’s “p-value”, says how easy the item was for the sample, and the correlation of the item with the examinees’ test scores, the point-biserial correlation, indexes how well it fits with the other items of the test. Wright and Stone call the first the most familiar traditional item statistic, and the second the next most widely used [Wright and Stone, 1979, pp. 25-26]. Both depend on the sample: the proportion correct on the mean and variance of its abilities (p. 25), and the point-biserial correlation on the spread and level of its scores, falling toward 0 as the proportion correct nears 0 or 1; no size of it marks an item as acceptable (p. 26).
irtlib correlates each item with the rest score, the examinee’s number correct on the other items: the point-biserial correlation of the item and the item-excluded test score [Baker, 1987, p. 123].
Definition#
The proportion correct of item \(i\) is the share of the examinees who answered it correctly [Wright and Stone, 1979, p. 25]. Examinee \(j\)’s rest score for item \(i\) is the sum of the examinee’s responses to the other items, \(R_{ij} = \sum_{k \ne i} u_{kj}\) [Robitzsch, 2021, p. 819], and the item-rest correlation is the point-biserial correlation of the responses \(u_{ij}\) with the rest scores, by Haberman’s standard estimate of the point-biserial correlation [Haberman, 2004, p. 47], with the rest score in place of the test score.
Wright and Stone and Haberman count every one of the \(N\) examinees. irtlib takes both statistics over the \(N_i\) examinees who answered item \(i\), all \(N\) when the responses are complete (see “Missing responses” below). With \(s_i\) of them answering the item correctly,
where the sums run over those \(N_i\) examinees and \(\bar R_i\) is their mean rest score; \(r_i\) is Pearson’s correlation of the responses and the rest scores.
Implementation#
Missing responses. Wright and Stone’s and Haberman’s sums run over every examinee, with no rule for a missing response. irtlib takes each item’s statistics over the \(N_i\) examinees who answered it, and each examinee’s rest score over the other items the examinee answered, with no source on the shelf for that rule; the sources wanted list it.
Statistics with no value are NaN: both statistics of an item nobody answered, and the correlation of an item that takes one value among the examinees who answered it, or whose rest score does, which includes a test of one item and a single examinee.
Comparison with mirt
mirt 1.48’s
itemstatscomputes the same statistics, its columnsmeanandcor_if_rm, with the same rule for missing responses: each item’s mean over the examinees who answered it, and the rest score as the sum of the other answered items, correlated over the examinees who answered the item (R/itemstats.R:110-120, 148). Itsempirical_plotdraws them, types"difficulty","discrim"and"discrim_diff"(manual p. 54).One departure: mirt leaves out an item nobody answered (
R/itemstats.R:107-109), where irtlib keeps it, with NaN for both statistics. No parity case has such an item.On LSAT6, LSAT7 and a simulated data set with a tenth of its responses missing, the parity tests find both statistics within a relative \(10^{-10}\) of mirt’s (ADR-0003).
Parameters#
proportion_correct() and item_rest_correlation()
take the response matrix, and have no settings.
Guarantees#
Each item gets one value, from the examinees who answered it; missing responses raise no error.
A statistic with no value is NaN, without a warning, and leaves the other items’ values as they are.
The item-rest correlation lies between -1 and 1, a perfect one included.
On the LSAT data, the proportions correct are those Rizopoulos [2006, p. 5] prints, and the item-rest correlations those that follow from the correlations with the total score and the frequencies of the total scores it prints (p. 6), within the rounding of the printed values.
References#
Frank B. Baker. Methodology review: item parameter estimation under the one-, two-, and three-parameter logistic models. Applied Psychological Measurement, 11(2):111–141, 1987. Open copy: https://hdl.handle.net/11299/103398. doi:10.1177/014662168701100201.
Shelby J. Haberman. Joint and conditional maximum likelihood estimation for the Rasch model for binary responses. Research Report RR-04-20, Educational Testing Service, Princeton, NJ, 2004. Open copy: https://files.eric.ed.gov/fulltext/EJ1110899.pdf. doi:10.1002/j.2333-8504.2004.tb01947.x.
Dimitris Rizopoulos. Ltm: an R package for latent variable modeling and item response theory analyses. Journal of Statistical Software, 17(5):1–25, 2006. Open access. doi:10.18637/jss.v017.i05.
Alexander Robitzsch. A comprehensive simulation study of estimation methods for the Rasch model. Stats, 4(4):814–836, 2021. Open access. doi:10.3390/stats4040048.
Benjamin D. Wright and Mark H. Stone. Best Test Design. MESA Press, Chicago, 1979. Open copy: https://www.rasch.org/BTD_RSA/pdf/Best%20Test%20Design.pdf.
API Reference#
Classical item statistics, which screen responses before a calibration: proportion correct and item-rest correlation.
Each function takes a response matrix, one row per examinee and one column per item, holding 1, 0 or NaN for a missing response, and returns one value per item, computed over the examinees who answered that item.
- irtlib.classical.item_rest_correlation(responses: ArrayLike) NDArray[floating[Any]][source]#
Return each item’s correlation with the rest score, the number of the other items an examinee got correct.
An examinee’s rest score counts the other items the examinee answered, and each item’s correlation runs over the examinees who answered it. It is NaN where fewer than two of them answered the item, or where the item or the rest score takes one value among them.
The Classical Item Statistics page gives the method and its sources.
- Parameters:
- responsesarray_like
The response matrix: one row per examinee, one column per item, 1 or 0, and NaN for a missing response.
- Returns:
- numpy.ndarray
The item-rest correlation of each item.
- Raises:
- TypeError
If the responses are neither Booleans, integers nor floats.
- ValueError
If the responses are not a matrix, or a response is not 0, 1 or NaN.
Examples
>>> import numpy >>> responses = numpy.array([[1, 1, 1], [1, 1, 0], [1, 0, 0], [0, 0, 0], [0, 1, numpy.nan]]) >>> item_rest_correlation(responses).round(4) array([0.3273, 0.3273, 0.5222])
- irtlib.classical.proportion_correct(responses: ArrayLike) NDArray[floating[Any]][source]#
Return each item’s proportion correct, over the examinees who answered it.
An item nobody answered gets NaN.
The Classical Item Statistics page gives the method and its sources.
- Parameters:
- responsesarray_like
The response matrix: one row per examinee, one column per item, 1 or 0, and NaN for a missing response.
- Returns:
- numpy.ndarray
The proportion correct of each item.
- Raises:
- TypeError
If the responses are neither Booleans, integers nor floats.
- ValueError
If the responses are not a matrix, or a response is not 0, 1 or NaN.
Examples
>>> import numpy >>> proportion_correct(numpy.array([[1, 0], [1, numpy.nan], [0, 1]])) array([0.66666667, 0.5 ])