Skip to content

Human judgment, preference, and annotation measurement · Human judgment, annotation, and latent measurement · HME008 · Model

Two-parameter logistic item-response model (2PL IRT)

Model binary item responses using respondent ability plus item difficulty and discrimination. It can distinguish an item’s location on the latent scale from how sharply it separates abilities.

Runs in CodeSplash Complete calculation CodeSplash's run and the reference's record

In CodeSplash

A CodeSplash method runs this entry in Python and R. Set it up from the method's page.

Do it in CodeSplash Run it on your own data, in Python or R.

Availability
Runs in CodeSplash
Code example
Complete calculation
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
Verified in Python and R through measurement.irt. The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review, on this exact code. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Model binary item responses using respondent ability plus item difficulty and discrimination. It can distinguish an item’s location on the latent scale from how sharply it separates abilities.

Question / hypotheses

Can a unidimensional latent trait explain item responses with item-specific slopes? A fitted ability score measures performance within the task/model; it does not establish a universal capability.

Architecture / computational structure

A latent ability enters item-specific logistic curves. Marginal likelihood integrates over an ability distribution, or Bayesian estimation samples abilities and item parameters. The model has no guessing parameter in its two-parameter form.

Assumptions

Unidimensionality, local independence conditional on ability, and an appropriate latent distribution are central. Item functioning should be comparable across intended groups. The latent location and scale require constraints, commonly a standard normal ability distribution; discrimination orientation must be defined.

Formula / computational definition

P(Yni=1∣θn)=σ{ai(θn−bi)},ai>0,Ii(θ)=ai2pi(θ){1−pi(θ)}.P(Y_{ni}=1\mid\theta_n)=\sigma\{a_i(\theta_n-b_i)\},\quad a_i>0,\qquad I_i(\theta)=a_i^2p_i(\theta)\{1-p_i(\theta)\}.

Parameters and notation

Estimated: item discrimination a_i, difficulty b_i, and ability distributions/scores under the estimation convention. Choices: latent dimensionality and scale, priors, quadrature or Monte Carlo settings, item constraints, missing-response policy, and scoring estimator. Information is conditional on model and ability, not a universal measure of item value.

Fitting, fine-tuning, and adaptation

Use common anchor items and check differential item functioning when linking forms or populations. New items need calibration. Reusing published item parameters in a new language or setting requires evidence of invariance rather than assuming translation preserves difficulty.

How to use and calibrate

Inspect item characteristic and information curves, local dependence, fit residuals, and subgroup behavior. For adaptive testing, separate item calibration from ability scoring and report stopping/selection rules. R route: mirt; the example computes curves at fixed parameters.

Example application

Study which reasoning benchmark items separate systems at different measured skill levels, while documenting the limited system population and possible correlated training exposure.

Interpretation / pitfalls

Watch out

An ability score can be dominated by benchmark composition or contamination. Difficulty is population/model-relative. Treating missing or not-reached responses as ordinary incorrect answers changes the measurement model.

Python and R code examples

Scope: Complete response probabilities and Fisher-information contributions for fixed item parameters. Python NumPy; R base.

Validation: Python executed successfully; native R reviewed but not executed.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Complete calculation — Complete response probabilities and Fisher-information contributions for fixed item parameters. Python NumPy; R base. · needs numpy

import numpy as np
theta=np.array([-1.,0.,1.]); a=np.array([.7,1.8]); b=np.array([-.4,.6])
p=1/(1+np.exp(-a[None,:]*(theta[:,None]-b[None,:])))
information=a[None,:]**2*p*(1-p)
assert np.all(information>=0);print(p);print(information)
R

Complete calculation — Complete response probabilities and Fisher-information contributions for fixed item parameters. Python NumPy; R base.

theta <- c(-1,0,1); a <- c(.7,1.8); b <- c(-.4,.6)
eta <- sweep(outer(theta,b,"-"),2,a,"*");p <- plogis(eta)
information <- sweep(p*(1-p),2,a^2,"*")
stopifnot(all(information>=0));print(p);print(information)

Sources

From the CodeSplash reference, entry HME008.