Conditional Mean Squares#
Motivation#
The Mean Squares compare each response with its probability at an ability estimated from the same responses, which lowers their expectation below 1. On data drawn from the Rasch model with 10, 15 and 20 items, Müller finds the mean outfit 0.91, 0.94 or 0.95, and 0.96, and the mean infit 0.94, 0.96 and 0.97, at weighted likelihood abilities, whatever the number of examinees [Müller, 2020, p. 8, Table 3]; Christensen and Kreiner know of “no published results” on how the choice of the ability estimate changes this [Christensen and Kreiner, 2013, p. 88].
Under the Rasch model the number correct is sufficient for the ability, and the probability of a correct response given the number correct depends on the items alone, so that “we do not have to be concerned about how person parameters are estimated” [Christensen and Kreiner, 2013, p. 89]. The conditional mean squares compare each response with that probability. Their mean is 1.00 on data that fit the model, at every test length and sample size Müller simulated, and he concludes that “conditional residuals should be used” [Müller, 2020, pp. 1, 8]. They need a calibration of the 1PL, such as one by Conditional Maximum Likelihood, and no abilities; for the 2PL to 4PL, S-X² groups the examinees by their number correct instead.
Definition#
An examinee with \(r\) correct responses answers item \(i\) correctly with the probability \(\pi_{ri}\) of the Conditional Maximum Likelihood page, which depends on the items’ difficulties alone [Christensen and Kreiner, 2013, p. 89, Equation 5.13]; [Müller, 2020, p. 4, Equation 7]. For examinee \(j\), with \(r\) correct, the residual of a response, its variance and its standardized value are
[Christensen and Kreiner, 2013, p. 86, Equations 5.6-5.7]. Over the examinees whose number correct is neither 0 nor \(M\), which tell nothing of the items’ fit (p. 85), \(n_r\) of them with \(r\) correct, the outfit and the infit of item \(i\) are
(p. 86, Equations 5.8-5.9), both with expectation 1 under the model (p. 86). The outfit is the mean, weighted by \(n_r / \sum_r n_r\), of the means of the identically distributed \(z_{ij}^2\) of the examinees with \(r\) correct, and so is asymptotically normal, with the variance of that weighted mean (pp. 89-90, Equations 5.14-5.15). A squared standardized residual has variance \(\operatorname{VAR}(z^2 \mid r) = C_{ri}/W_{ri}^2 - 1\) [Wright and Masters, 1982, p. 100, Table 5.4a], where \(C_{ri} = W_{ri}\,(\pi_{ri}^3 + (1 - \pi_{ri})^3)\) is the kurtosis of a response (p. 98, Equation 5.4.4), so that
At \(\pi_{ri} = .1\), \(z^2\) is 0.1111 or 9, with variance 7.1 [Christensen and Kreiner, 2013, p. 87].
The infit’s distribution “can be derived in the same way” [Christensen and Kreiner, 2013, p. 90], with no formula printed. irtlib derives it so: given the numbers correct, the infit’s denominator is fixed, and the \(y_{ij}^2\) of the examinees with \(r\) correct are identically distributed with mean \(W_{ri}\) and variance \(C_{ri} - W_{ri}^2\), so that
the variance \(q_i^2\) of the weighted mean square [Wright and Masters, 1982, p. 101, Equation 5.4.8] at the conditional probabilities. Each mean square is standardized as \((U_i - 1)/\operatorname{VAR}(U_i)^{1/2}\) and \((V_i - 1)/\operatorname{VAR}(V_i)^{1/2}\), with no cube root, which brought the conditional statistics “no apparent improvement” in Müller’s simulations [Müller, 2020, p. 6]; Christensen and Kreiner’s two-sided normal \(p\)-values follow from these, an outfit of 1.237 with a standard deviation of 0.107 having \(p = .027\) [Christensen and Kreiner, 2013, p. 90, Table 5.1].
Implementation#
The model. The number correct is sufficient for the ability under the Rasch model [Christensen and Kreiner, 2013, p. 89], so the conditional mean squares take a calibration of the 1PL: every item with the same slope \(a\), \(c = 0\) and \(d = 1\), whose Rasch item parameters are \(a b_i\) [Wright and Masters, 1982, p. 38, Equation 3.1.1], so that \(\varepsilon_i = e^{-a b_i}\). Its likelihood does not matter: no ability and no grid is used.
Items and examinees left out. An item the calibration left without an estimate, as Conditional Maximum Likelihood leaves an item answered correctly by every examinee or by none, has no probabilities, and its values are NaN; the numbers correct count the other items. The examinees with none or all of those correct are left out of every item’s sums [Christensen and Kreiner, 2013, p. 85]; after a calibration by conditional maximum likelihood, they are the examinees it left out. The sources sum over complete responses, and a missing response is refused, as for the Mean Squares (ADR-0006).
The probabilities come from the logarithms of the elementary symmetric functions, by the summation algorithm of Conditional Maximum Likelihood, which keeps long tests from overflowing.
The standard deviations are asymptotic. Müller finds them too large, because the squared residuals of an item are negatively correlated, so that the standardized values come out too small and a fitting item is rejected less often than the nominal level; he recommends a parametric bootstrap for the outfit’s \(p\)-values [Müller, 2020, pp. 1, 8, 10]. irtlib reports the asymptotic values. On Müller’s design, 20 data sets of 2,000 examinees with items from Conditional Maximum Likelihood, the outfit and infit averaged 0.998 and 1.000 with 10 items, and 1.000 with 20; 2.5% to 3.5% of the fitting items had a standardized outfit beyond ±1.96, and 1% a standardized infit (measured 2026-12-02).
Parameters#
conditional_mean_squares() takes the calibration and the responses it was
calibrated on, and has no settings.
Guarantees#
Each item gets its conditional outfit and infit and their standardized values, from a calibration of the 1PL of any likelihood, without abilities.
An item the calibration left without an estimate gets NaN. The examinees with none or all of the other items correct are left out of every item’s sums, without a warning; when no examinee is left, every value is NaN.
A calibration of a model other than the 1PL, or a missing response, raises an error.
References#
K. B. Christensen and S. Kreiner. Item fit statistics. In K. B. Christensen, S. Kreiner, and M. Mesbah, editors, Rasch Models in Health, pages 83–104. ISTE and Wiley, 2013. doi:10.1002/9781118574454.ch5.
Marianne Müller. Item fit statistics for Rasch analysis: can we trust them? Journal of Statistical Distributions and Applications, 7:5, 2020. Open access. doi:10.1186/s40488-020-00108-7.
Benjamin D. Wright and Geoffrey N. Masters. Rating Scale Analysis. MESA Press, Chicago, 1982. Open copy: https://www.rasch.org/BTD_RSA/pdf/Rating%20Scale%20Analysis.pdf.
API Reference#
- irtlib.fit.conditional_mean_squares(calibration: Calibration, responses: NDArray[floating[Any]]) MeanSquares[source]#
Return the conditional outfit and infit mean squares of every item of a 1PL calibration, from its responses.
Each response is compared with its probability given the examinee’s number correct, which under the 1PL depends on the items alone, so that no ability is estimated. An item the calibration left without an estimate, with a NaN difficulty, gets NaN, and the numbers correct count the other items; the examinees with none or all of those correct are left out of every item’s sums, without a warning. Each mean square is standardized as its difference from 1 over its standard deviation under the model.
The Conditional Mean Squares page gives the method and its sources.
- Parameters:
- calibrationCalibration
A calibration of the 1PL, of any likelihood, whose items all have the same slope,
c = 0andd = 1.- responsesnumpy.ndarray
The complete response matrix the calibration estimated its items from: one row per examinee, one column per item, 1 or 0.
- Returns:
- MeanSquares
Each item’s conditional outfit and infit, and their standardized values; NaN throughout when every examinee has none or all of the estimated items correct.
- Raises:
- TypeError
If the responses are neither Booleans, integers nor floats.
- ValueError
If the calibration’s items are not those of a 1PL; or the responses fail
irtlib.calibration.validate_responses(), have a missing response, or do not have one column per item of the calibration.
Examples
>>> import numpy >>> from irtlib.cml import CMLCalibrator >>> from irtlib.drawing import draw_responses >>> items = numpy.column_stack([numpy.ones(4), [-1.0, -0.3, 0.3, 1.0], numpy.zeros(4), numpy.ones(4)]) >>> responses = draw_responses(numpy.random.default_rng(1).normal(size=500), items, rng=2) >>> fit = conditional_mean_squares(CMLCalibrator().calibrate(responses), responses) >>> fit.outfit.round(3), fit.infit.round(3) (array([1.004, 1.093, 0.968, 0.907]), array([1.003, 1.072, 0.984, 0.952]))