Item Response Theory
How can two people who took different questions be put on the same scale?
In the 1950s the Danish mathematician Georg Rasch was asked to compare reading across tests that share no items. Classical scores cannot do it: difficulty depends on the sample and scores on the test. Rasch modelled the single encounter of one person with one item, and person and item separate. The part derives the model's specific objectivity and the sufficiency of the sum score, adds discrimination and guessing, measures information, fits the Law School Admission Test's items by marginal maximum likelihood (matching the published fits), builds an adaptive test that needs about half the items of the best fixed form, fits graded responses to attitude items, separates bias from impact with Mantel and Haenszel, links two forms through anchors, shows why national surveys report plausible values drawn from a conditioning model, and tracks learning with knowledge tracing and Elo.
What you need. Part 3's classical test theory, Part 12's logistic functions and Part 44's latent variables; the logistic function, likelihood and Fisher information.
- Hook
- Rasch's reading tests
- Ideas, models and mathematics
- Rasch, 2PL and 3PL, information, estimation, adaptive testing, differential item functioning, equating, plausible values, knowledge tracing
- Psyche gains
psyche.irt; an adaptive test- On you
- a ten-item adaptive test (unscored)
What you will be able to do
Psych 101 and the major
- Explain why a classical score depends on the test and an item's difficulty on the sample.
- Read an item characteristic curve: difficulty, discrimination and guessing.
- Say why a group gap on an item is not by itself evidence that the item is unfair.
Graduate
- Derive the sufficiency of the sum score in the Rasch model and fit it by conditional ML.
- Fit Rasch and two-parameter models by marginal ML with EM; compute item and test information, and build an adaptive test.
- Run a Mantel-Haenszel DIF analysis, a mean-sigma linking and a plausible-value analysis.
Research
- Argue how response times, generated items or learning test-takers change what a calibrated scale can claim.
Practice
- Plan an adaptive questionnaire: bank, stopping rule, exposure control and a DIF check.
Contents
Each chapter has a home level. Choose a track to see what to read and watch: Psych 101 and the major 12 min · Graduate 26 min · Research 27 min · Practice 13 min.
- 0Different questions, one scalePsych 101 and the major2 min
- 1On you: an adaptive test, and four numbersPsych 101 and the major2 min
- 2What classical theory cannot doPsych 101 and the major1 min
- 3The Rasch modelPsych 101 and the major2 min
- 4Two and three parametersGraduate1 min
- 5InformationGraduate1 min
- 6EstimationGraduate2 min
- 7Adaptive testingGraduate2 min
- 8Rating scalesGraduate1 min
- 9Fairness as a statisticPsych 101 and the major1 min
- 10Linking and equatingGraduate2 min
- 11Large-scale assessmentGraduate1 min
- 12Tracking learningGraduate2 min
- 13The LedgerGraduate
- 14In practice: exams, clinics and machinesPractice1 min
- 15Frontier: time, generated items and learning systemsResearch1 min
- Recap, problems, and the road aheadAll tracks3 min
Also on this page: Lecture · Key results · Try it · Lab · Problems · Notes and sources · Build the film.
Lecture
The text of each chapter is the film's narration, as it is spoken, so you can read along or revise without the film. The pictures are in the film.
Different questions, one scalePsych 101 and the major2 min
Two pupils of exactly the same ability take a reading test. One gets an easy form, the other a hard one, with no items in common. Their expected scores are about eight out of ten, and about three. A score says how a person did on these items. It can't say how they'd do on others. So the question for this part: can people who took different questions be put on one scale?
The answer came from Denmark. In the 1950s the mathematician Georg Rasch was asked to compare children's reading across tests that shared no items. In his 1960 book he modelled the single encounter of one person with one item. The odds of success depend only on ability minus difficulty. And then the person and the item separate. Abilities can be compared without the items, and items without the people. From that idea came adaptive tests, a statistical definition of an unfair item, national surveys of what students know, and ways to track what a learner knows.
So this part asks how to measure with questions that differ from person to person. What classical scores can't do, and the Rasch model that can. Discrimination, guessing, and how much an item tells you. Estimation, adaptive tests, and rating scales. And fair items, linked forms, national surveys, and learning.
This is Part 45 of Psychology, Built: item response theory. We'll build the Rasch model and derive why the sum score is all you need. We'll add discrimination and guessing, and measure how much each item tells you. We'll estimate items by marginal maximum likelihood, on real test data. We'll build an adaptive test and compare it with fixed forms. We'll fit rating scales, find unfair items and link two forms. And we'll see how national surveys report a population, and how software tracks what a learner knows.
What it does: Two forms, one ability; one person, one item; the question; objectives
1On you: an adaptive test, and four numbersPsych 101 and the major2 min
First, watch an adaptive test at work. Psyche takes it, with a true ability of one point three. Each question is chosen to be the most informative at the current estimate: one this person has about an even chance of getting right. Right answers bring harder items, wrong ones easier. Each mark sits at that item's difficulty. The band around the estimate narrows with every answer, and the test stops when the standard error falls below zero point three. On the course site you can take a short adaptive test yourself. It isn't scored, and nothing is stored.
Now four numbers to write down. One: an adaptive test from a bank of three hundred items stops when its standard error reaches zero point three. About how many items does it give? Two: how many items does the best fixed form need to be as accurate? Three: five items from a law-school admission test, answered by a thousand people. Does each item need its own discrimination, or is the simplest model enough? And four: two groups differ in ability by zero point eight standard deviations. On a perfectly fair item, by how much do their proportions correct differ? Pause here, and write them down.
What it does: An adaptive test narrowing; four predictions
2What classical theory cannot doPsych 101 and the major1 min
Classical test theory, from Part 3, has three blind spots. The first: an item's difficulty is the proportion who get it right. Give the same ten items to a weaker and a stronger group. The middle item is answered by about four in ten of one group, and seven in ten of the other. So an item's difficulty depends on the sample, and, as the hook showed, a person's score depends on the test. Neither belongs to the item or the person alone. Yet these items have one difficulty each, set once when Psyche made them.
The third blind spot. Classical theory gives one standard error of measurement for everyone: the standard deviation times the square root of one minus reliability. But a test of middling items measures middling people well, and people at the extremes badly. Item response theory gives a standard error for each ability, from how much the items tell us there. It's smallest in the middle, and grows at both ends. So there are three things to fix: items whose difficulty doesn't depend on the sample, scores that don't depend on the test, and an error for each person.
What it does: Difficulty depends on who answers; one error for everyone?
3The Rasch modelPsych 101 and the major2 min
Rasch's model is one encounter. A person has an ability, theta. An item has a difficulty, b, on the same scale. The log-odds of success is ability minus difficulty. So a person whose ability equals the item's difficulty has an even chance. Every item's curve has the same shape, shifted along the ability axis. It's called the item characteristic curve. One encounter, two parameters. Everything else follows from multiplying encounters together.
Now the property Rasch prized. Compare two people on any item. The difference in their log-odds is their difference in ability, whichever item is used. Compare two items on any person. The difference is their difference in difficulty, whoever answers. Rasch called this specific objectivity: comparisons of people free of the items, and of items free of the people. It holds only if every item's curve has the same slope. With different slopes, the comparison depends on where you look.
And the Rasch model's best property. Ask how likely a pattern of answers is, given its sum score. Write it out, and ability cancels. What's left involves only the items. Here are four patterns with two right, on five items from a law-school admission test, at three very different abilities. The probabilities are identical. So the sum score carries everything the answers say about ability. And the items can be estimated with ability conditioned away entirely. It's called conditional maximum likelihood.
What it does: One encounter; specific objectivity; the sum score is enough
4Two and three parametersGraduate1 min
Real items aren't all alike. Discrimination, a, is how steeply the curve rises. A steep item sorts people sharply near its difficulty. A flat one barely sorts them at all. Guessing, c, is a floor. On a four-option item, even the least able get about a quarter right. Allan Birnbaum wrote these two- and three-parameter models into Lord and Novick's 1968 textbook, and Frederic Lord's 1980 book made them standard. The price: with unequal slopes, the sum score is no longer sufficient, and specific objectivity is lost.
Does it matter in practice? Here are five items from the Law School Admission Test, answered by a thousand people, the data Darrell Bock and Robert Lieberman fitted in 1970. The Rasch model, with one shared slope, against the two-parameter model, with a slope for each item. The likelihood ratio is about half a point on four degrees of freedom. The extra slopes buy nothing here. And look where the curves sit. The items are easy, so this test sorts weak candidates well, and strong ones hardly at all.
What it does: Discrimination and guessing; five law-school items
5InformationGraduate1 min
How much does one answer tell us? An item's information is the Fisher information about ability in a single answer: discrimination squared, times P, times one minus P. It peaks where the item's difficulty meets the person's ability, at a height of a squared over four. A steep item informs a lot, in a narrow range. Information adds across items, and the standard error is one over its square root. So a test can be designed: put the information where the decisions are. With guessing, information falls for low abilities, because a right answer might be luck.
Now the law-school items. Their test information peaks near minus one point eight, far below the average candidate. And even at its peak it's only about zero point six: a standard error of at least one point three, more than the spread of the people being measured. Five items can sort a crowd roughly, but can't place one person precisely. The cure is more items where they're needed. That's what an adaptive test does.
What it does: Fisher information, item by item; what five easy items can measure
6EstimationGraduate2 min
Here's the puzzle. To estimate the items, you need the people's abilities, and to estimate abilities, you need the items. The joint approach estimates both at once. But the abilities multiply with the people, and the item estimates stay biased however many people you add. The conditional approach conditions on each sum score, so ability vanishes. It's exact, but only for the Rasch model. The marginal approach treats ability as drawn from a population, say a normal one, and integrates it out. The likelihood of each answer pattern, averaged over abilities.
Darrell Bock and Murray Aitkin made the marginal approach practical in 1981, with EM. Replace the integral by a grid of abilities, weighted by the normal curve. In the E step, find each person's posterior over the grid, given their answers and the current items. In the M step, each item becomes a weighted logistic regression on the grid: so many expected people, and so many expected right answers, at each ability. On the law-school items, the log-likelihood climbs and stops. The estimates match the published fits to three decimal places.
With the items known, each person's ability follows. Maximum likelihood finds the ability that makes the answers most likely. For all right or all wrong, it's infinite. The expected a posteriori estimate is the mean of the posterior, with the population as the prior. It's always finite, and pulled toward the mean. With five items, the posterior standard deviation stays near zero point eight. The prior's one barely shrinks. That shrinkage is right for one person's best guess, and wrong for describing a population, as chapter eleven will show.
What it does: Three ways to estimate items; Bock and Aitkin's EM; each person's ability
7Adaptive testingGraduate2 min
An adaptive test is four steps, repeated. Estimate: start at the population mean, and after each answer, update the posterior. Choose: the unused item with the most information at the current estimate. Ask it. And stop when the standard error is small enough, or the test is long enough. Each person gets their own test, but every score is on one scale, because the items were calibrated first. It's the payoff of Rasch's idea.
How much does it save? Psyche gives a thousand simulated people a calibrated bank of three hundred items. The adaptive test stops after about seventeen items on average. The best fixed form, built for the average person, needs about thirty-five items for the same accuracy. A random fixed form needs even more. The saving is largest for people far from average, whom a fixed form measures worst.
The costs. Exposure. The first item is the most informative at the mean, so everyone gets it. Here, every single test-taker. Shared online, it's no longer a test item. So real tests choose at random among the few best items, or cap each item's rate. A test must also cover its topics, so the choice is constrained. And it needs a bank of hundreds of items, each pre-tested on enough people to know its curve.
What it does: Four steps, repeated; the same precision with half the items; the costs
8Rating scalesGraduate1 min
Questionnaires rarely have right answers. They have categories, from strongly disagree to strongly agree. Fumiko Samejima's graded response model gives each step a threshold: the attitude at which a person becomes likelier than not to answer at least that category. Here's an item from a European survey of 1992: thanks to science and technology, there will be more opportunities for the future generations. Each category has its own curve, and its own stretch of the attitude axis. Geoff Masters's partial credit model is the Rasch version.
Fit all four positively worded items. Three hundred and ninety-two people, four categories each. The item about the future discriminates most: it sorts people by their attitude most sharply. And the first thresholds sit far below the people. Almost no one strongly disagrees, so those categories carry little information. Part 46 asks what happens between the question and the answer, and whether everyone uses the categories the same way.
What it does: Samejima's graded responses; four items, four discriminations
9Fairness as a statisticPsych 101 and the major1 min
When is an item unfair? Psyche makes two groups of three thousand whose mean abilities differ by zero point eight standard deviations, and fifteen items that are all perfectly fair. On item eight the groups' proportions correct differ by about fifteen points. That is impact: a difference between the groups, not in the item. So compare people of equal ability instead, matched on their total score. The two groups' curves lie on top of each other. An item is unfair, in the statistical sense, when people of equal ability have unequal chances. It's called differential item functioning.
Testing companies screen every item this way. At each total score, make a two by two table, group by right or wrong, and pool the odds ratios across scores. Paul Holland and Dorothy Thayer brought Mantel and Haenszel's method to testing in 1988. On the fair item, the index is near zero: negligible. Now make item eight harder by zero point eight for the focal group only. The curves separate, and the index flags it in the most serious category. A flag is a question for content experts, not a verdict: what in this item favours one group?
What it does: A gap is not a bias; Mantel and Haenszel, score by score
10Linking and equatingGraduate2 min
A test given every year faces a problem. Its items must change, or they leak. But each year's calibration puts that year's people at a mean of zero and a standard deviation of one. The zero of the scale moves with the cohort. If this year's students are abler, a separate calibration hides it, and makes this year's items look harder than they are. The fix is common items, called anchors, given in both years, whose difficulties tie the two scales together.
Here's linking at work. Psyche makes two thirty-item forms that share ten anchors. This year's students are abler and more varied. Calibrate each form alone, and the anchors' two sets of difficulties fall on a line, but not on the diagonal. The slope and intercept of that line come from the anchors' means and standard deviations. Here, one point two one and zero point four three, against a truth of one point two and zero point five. Before linking, the new items' difficulties were off by about zero point four. After, by less than zero point one.
Linking puts the items on one scale. Equating puts the scores there too. Each form has a test characteristic curve: the expected score at each ability, now on last year's scale. This year's form is a little harder. A score of fifteen on it means the ability that scores about sixteen on last year's. True-score equating reads across the two curves: from a score, to an ability, to the other form's score. So a pass mark can mean the same thing every year, though no two years share a test.
What it does: Two years, two forms; mean and sigma; from score to score
11Large-scale assessmentGraduate1 min
National surveys of what students know have a different goal. They want to describe a country's students across a whole curriculum, which means far more items than one student can answer. So they use matrix sampling: a pool of items split into booklets, and each student answers one booklet. The population is measured well, and each student badly. Six items can't place one person. So the survey reports groups, not students. That's why a national survey gives no individual scores.
How then do you describe the population? Each student's expected a posteriori estimate is shrunk toward the mean. So the spread of the scores falls from one to about zero point seven, and a true gap of zero point four between two groups shows as about zero point two. Plausible values are random draws from each student's posterior, not its mean. The spread comes back, but the gap is still shrunk. Draw them from a model that includes the groups, called the conditioning model, and the gap comes back too. Robert Mislevy set this out in 1991. A plausible value isn't a score. Analyse each set, and combine them, as in multiple imputation.
What it does: Many items, few per student; plausible values
12Tracking learningGraduate2 min
Testing assumes ability holds still. Tutoring software assumes the opposite. In 1995 Albert Corbett and John Anderson treated each skill as a hidden state, unknown or known, and each practice as a chance to learn it. Answers are noisy: a lucky guess when it's unknown, a slip when it's known. It's a hidden Markov model. Psyche simulates five hundred students, ten practices each, and the fit recovers the learning, guessing and slipping rates. A tutor moves a student on when the chance the skill is known passes about ninety-five percent.
Here is one simulated student. Before each answer, the model's chance that the skill is known. A wrong first answer keeps it low. Then each right answer raises it, quickly, because a guess is unlikely twice in a row. It passes ninety-five percent within a few practices: mastery, by this rule. The same filter runs for every skill and every student, in tutors used by many thousands of pupils.
Two other ways to track. Elo's rating, from chess: after each answer, the learner's rating moves up and the item's down, by a step times the surprise. Run on the same answers, the later practice items look easier. But they're the same skill. The learners learned. A model that holds ability still reads learning as easy items. Tracking learning needs a model of change. Deep knowledge tracing used a neural network instead. Its first large gains shrank against tuned simple models. That's in the Ledger.
What it does: Bayesian knowledge tracing; one student; Elo and deeper models
13The LedgerGraduate
What the two have in common. Both are claims about efficiency: fewer items, better predictions. The first held, because the model behind it had been tested first. The second shrank, because the comparison was unfair: a strong new model against a weak old one. A new method's gain is only as large as the best version of the old one allows.
What it does: Two rows; what they have in common
14In practice: exams, clinics and machinesPractice1 min
Where it runs. Admission and licensing exams, many of them adaptive. New items are tried out unscored inside live tests, then calibrated. Language tests that place people on a common scale of levels. Clinical item banks for symptoms such as fatigue, pain and depression, where a handful of adaptive questions replaces a long form. And learning platforms, where knowledge tracing and Elo ratings decide the next exercise.
And one new kind of test-taker. Benchmarks for AI systems are tests: items of different difficulty and discrimination, given to many test-takers. Fit an item response model to the systems' answers, and a small set of informative items ranks systems almost as well as thousands. Items with low or negative discrimination are often mislabelled, and an item every system gets right tells you nothing. The same questions apply. Is the item calibrated? Does it function the same for every kind of system? And is the scale stable as the systems change? Statistics, Built takes this up in Part 64.
What it does: Where it runs; measuring machines
15Frontier: time, generated items and learning systemsResearch1 min
Three frontiers. Response times. Every answer comes with a time. Wim van der Linden's hierarchical model treats speed as a second trait, joining Part 25's models of deciding to testing. Generated items. Language models can write thousands of items, and their difficulty can be predicted from their features, but each still needs calibrating on people. And learning systems. A test-taker that improves between items, or between versions, breaks the assumption that ability holds still.
Open questions. When is a fast wrong answer a guess, and a slow right one a careful thinker? Can generated items be calibrated without pre-testing each one on people? How should a scale be kept stable when the test-takers, human or machine, change faster than the items? And can an adaptive test be fair to every group while still choosing the most informative item?
What it does: Three frontiers; open questions
Recap, problems, and the road aheadAll tracks3 min
First, your four numbers. The adaptive test gave about seventeen items. The best fixed form needed about thirty-five for the same accuracy. For the law-school items, the Rasch model is enough: the extra slopes bought half a point of likelihood. And on a perfectly fair item, groups zero point eight apart differ by about fifteen points: impact, not bias. Put the items on one scale first, and tests can be shorter, fairer, and comparable across years.
Part forty-five in twelve lines. Classical difficulty depends on the sample, and scores on the test. In Rasch's model, the log-odds of success is ability minus difficulty. That gives specific objectivity, and a sufficient sum score. Discrimination and guessing add two more parameters. Information adds across items, and the standard error is one over its square root. Items are estimated by marginal maximum likelihood, and abilities by the posterior. An adaptive test reaches the same precision with about half the items. Graded responses model rating scales. Fairness compares people of equal ability, because a gap is not a bias. Anchors link this year's scale to last year's. Surveys report populations with plausible values. And knowledge tracing follows ability as it changes.
Kant's wager. The first objection, that mathematics can't apply to the mind, met the Rasch and graded response models fitted to real tests, matching the published fits, and an adaptive test built from scratch. Green. The second, that the mind can't be experimented on: items are calibrated by experiment, pre-tested, checked for bias and linked. Green. And the third, about introspection: ability is measured by answers, not reports of inner states, but attitude items still rest on self-report. Amber.
Where this comes back. What happens between a question and its answer is next, in Part 46. Ability and learning over time are Part 47. Fitting models of behaviour is Part 48. And reading a whole literature as evidence is Part 50.
Seven problems, with full solutions in this part's README. One computes a Rasch probability. One finds an item's information. One finds a test's standard error. One checks sufficiency by hand. One links two forms. One runs a step of knowledge tracing. And the last, with the star, asks you to design an adaptive questionnaire that works the same in two languages. Pause here if you'd like to try them.
The books and papers behind this part are listed here and in the README. Susan Embretson and Steven Reise's book is the friendliest introduction for psychologists; Frederic Lord's is the classic; and van der Linden's handbook covers every model in this part and many more.
Two parts of the graduate toolkit done. This one put people who answered different questions on one scale. Next, the answer itself. How do you turn I prefer this one into a number, and what happens between a question and its answer? Part 46: scaling, surveys and choice.
Where it goes next. What happens between a question and its answer is Part 46; ability and learning over time Part 47; response-time models Part 48; the weight of evidence Part 50.
Key results
The part's results in one place, for revision.
Try it
Lab 45 · Item Response Theory
Fit the Rasch and two-parameter models to five LSAT items, check that the sum score is sufficient, see where the test is informative, then build an adaptive test, flag an unfair item and trace a learner.
python -m videos.psychology.labs 45
needs numpy, scipy, matplotlib · download lab45.py ·
source on GitHubLSAT Rasch: common a; b 0.755; -3.615, -1.322, -0.318, -1.730, -2.780
LSAT 2PL: a; log-likelihoods (Rasch, 2PL); LR on 4 df 0.83, 0.72, 0.89, 0.69, 0.66; -2466.94, -2466.65; 0.57
conditional ML difficulties (centred) -1.256, 0.475, 1.236, 0.168, -0.623
P(1 1 0 0 0 | score 2), free of ability 0.129
LSAT test information: peak and where; smallest SE 0.58 at -1.8; 1.31
adaptive test: mean items; RMSE 16.7; 0.296
best fixed forms: RMSE at 15, 25, 35, 45 items 0.367, 0.326, 0.253, 0.251
Mantel-Haenszel: fair item 4 (delta, category); item 8 made harder (delta, category) 0.20, A; -2.01, C
knowledge tracing fit (truth 0.2, 0.15, 0.2, 0.1) L0 0.20, T 0.15, G 0.20, S 0.12
The Rasch model is enough for the LSAT's five easy items, which inform mostly about weak candidates; an adaptive test matches a fixed form of about twice its length; matching on score separates bias from impact.
The code (90 lines; it asserts its own result)
"""Lab 45: item response theory: Rasch and two-parameter fits to the LSAT by marginal ML, conditional ML and the
sufficient sum score, information, an adaptive test against fixed forms, Mantel-Haenszel DIF, and knowledge
tracing."""
import numpy as np
from videos.coursekit import labs
from explainer.psychology import opendata
from explainer.psychology.psyche import irt as I
TITLE = "Item Response Theory"
GOAL = ("Fit the Rasch and two-parameter models to five LSAT items, check that the sum score is sufficient, see where "
"the test is informative, then build an adaptive test, flag an unfair item and trace a learner.")
TASKS = [
"Fit the three-parameter idea by hand: add a guessing floor of 0.2 to every item in the adaptive test's bank. How "
"many more items does it need?",
"Make the DIF item 0.3 harder for the focal group instead of 0.8. Which ETS category does it fall in?",
"Give the knowledge-tracing students 5 practices instead of 10. How well are the four parameters recovered?",
]
def run(seed=0):
out = labs.Lab()
X = opendata.lsat_1000()["X"]
r = I.fit_mml(X, "rasch")
t = I.fit_mml(X, "2pl")
out.row("LSAT Rasch: common a; b", f"{r['a'][0]:.3f}; " + ", ".join(f"{v:.3f}" for v in r["b"]))
out.row("LSAT 2PL: a; log-likelihoods (Rasch, 2PL); LR on 4 df",
", ".join(f"{v:.2f}" for v in t["a"]) + f"; {r['loglik']:.2f}, {t['loglik']:.2f}; "
f"{2 * (t['loglik'] - r['loglik']):.2f}")
assert abs(r["loglik"] + 2466.938) < 0.01
c = I.fit_cml(X)
out.row("conditional ML difficulties (centred)", ", ".join(f"{v:.3f}" for v in c["b"]))
p1 = I.pattern_given_score([1, 1, 0, 0, 0], c["b"])
out.row("P(1 1 0 0 0 | score 2), free of ability", f"{p1:.3f}")
th = np.linspace(-6, 4, 201)
inf = I.info(th, t["a"], t["b"]).sum(1)
out.row("LSAT test information: peak and where; smallest SE", f"{inf.max():.2f} at {th[inf.argmax()]:.1f}; "
f"{1 / np.sqrt(inf.max()):.2f}")
rng = np.random.default_rng(seed + 45)
a, b = np.exp(rng.normal(0.2, 0.25, 300)), rng.uniform(-3, 3, 300)
people = rng.normal(size=200)
runs = [I.cat(float(p), a, b, stop_se=0.3, max_items=60, seed=seed + i) for i, p in enumerate(people)]
n_items = np.array([len(x["items"]) for x in runs])
rmse = np.sqrt(np.mean((np.array([x["theta"] for x in runs]) - people) ** 2))
best = np.argsort(-I.info(0.0, a, b)[0])
fixed = {}
for k in (15, 25, 35, 45):
idx = best[:k]
e = I.eap(I.simulate(people, a[idx], b[idx], seed=k), a[idx], b[idx])["theta"]
fixed[k] = float(np.sqrt(np.mean((e - people) ** 2)))
out.row("adaptive test: mean items; RMSE", f"{n_items.mean():.1f}; {rmse:.3f}")
out.row("best fixed forms: RMSE at 15, 25, 35, 45 items", ", ".join(f"{fixed[k]:.3f}" for k in fixed))
g = np.repeat([0, 1], 3000)
th2 = rng.normal(size=6000) - 0.8 * g
bb = np.linspace(-1.5, 1.5, 15)
Xd = I.simulate(th2, 1.0, bb, seed=seed + 7)
Xd[:, 7] = rng.random(6000) < 1 / (1 + np.exp(-(th2 - np.where(g == 1, bb[7] + 0.8, bb[7]))))
mh = I.mantel_haenszel(Xd, g, 7)
mh0 = I.mantel_haenszel(Xd, g, 3)
out.row("Mantel-Haenszel: fair item 4 (delta, category); item 8 made harder (delta, category)",
f"{mh0['delta']:.2f}, {mh0['category']}; {mh['delta']:.2f}, {mh['category']}")
Y, _ = I.bkt_simulate(400, 10, 0.2, 0.15, 0.2, 0.1, seed=seed + 9)
f = I.bkt_fit(Y)
out.row("knowledge tracing fit (truth 0.2, 0.15, 0.2, 0.1)", f"L0 {f['L0']:.2f}, T {f['T']:.2f}, G {f['G']:.2f}, "
f"S {f['S']:.2f}")
out.note = ("The Rasch model is enough for the LSAT's five easy items, which inform mostly about weak candidates; "
"an adaptive test matches a fixed form of about twice its length; matching on score separates bias "
"from impact.")
fig, ax = labs.figure(2, size=(11, 4.0))
for j in range(5):
ax[0].plot(th, I.prob(th, t["a"][j], t["b"][j])[:, 0], label=f"item {j + 1}")
ax[0].set(title="LSAT item characteristic curves (2PL)", xlabel="ability", ylabel="P(correct)")
ax[0].legend(fontsize=7)
ax[1].plot(list(fixed), list(fixed.values()), "o-", color=labs.BLUE, label="best fixed form")
ax[1].plot([n_items.mean()], [rmse], "s", color=labs.GREEN, ms=9, label="adaptive")
ax[1].set(title="error against test length", xlabel="items", ylabel="RMSE")
ax[1].legend(fontsize=8)
out.fig = fig
return out
if __name__ == "__main__":
print(run())
Now change it
- Fit the three-parameter idea by hand: add a guessing floor of 0.2 to every item in the adaptive test's bank. How many more items does it need?
- Make the DIF item 0.3 harder for the focal group instead of 0.8. Which ETS category does it fall in?
- Give the knowledge-tracing students 5 practices instead of 10. How well are the four parameters recovered?
Problems, with solutions
Try each problem before opening its solution.
-
A Rasch probability. Under the Rasch model, a person with \(\theta = 1\) meets an item with \(b = 0.5\). Find the probability of a right answer.
Solution
e^0.5/(1 + e^0.5) = 1.649/2.649 = 0.622.
-
Information. An item has \(a = 2\), \(b = 0\). Find its information at \(\theta = 0\) and at \(\theta = 1\).
Solution
At θ = 0, P = 0.5 and I = 4 × 0.25 = 1. At θ = 1, P = 1/(1 + e^-2) = 0.881 and I = 4 × 0.881 × 0.119 = 0.42.
-
A test's standard error. Ten items, each with \(a = 1.5\), all at difficulty equal to a person's ability. Find the test information and the standard error.
Solution
Each item gives 1.5² × 0.25 = 0.5625; ten give 5.625, so SE = 1/√5.625 = 0.42.
-
Sufficiency by hand. Rasch items with \(b_1 = 0\) and \(b_2 = 1\). Given a score of 1, find the probability that the right answer was item 1, and show it does not depend on \(\theta\).
Solution
P(1 0 | r = 1) = e^0/(e^0 + e^-1) = 1/(1 + 0.368) = 0.731, whatever θ: the factor e^θ/((1 + e^(θ-0))(1 + e^(θ-1))) is common to both patterns and cancels.
-
Linking. The anchors' difficulties have mean 0 and SD 0.8 on this year's scale, mean 0.4 and SD 1.0 on last year's. Find \(A\) and \(B\), and put a new item with \(b = 1\) on last year's scale.
Solution
A = 1.0/0.8 = 1.25, B = 0.4 - 1.25 × 0 = 0.4; the new item's difficulty on last year's scale is 1.25 × 1 + 0.4 = 1.65.
-
A step of knowledge tracing. Knowledge tracing with \(L_0 = 0.2\), \(T = 0.15\), \(G = 0.2\), \(S = 0.1\). A student answers right. Find P(known) after the update and after the learning step.
Solution
After a right answer, P(known) = 0.2 × 0.9/(0.2 × 0.9 + 0.8 × 0.2) = 0.18/0.34 = 0.529; after the learning step, 0.529 + 0.471 × 0.15 = 0.600.
-
★ An adaptive anxiety questionnaire. Design an adaptive anxiety questionnaire: its bank, its stopping rule, its exposure control, and the check that it works the same in two languages.
Solution
A bank of 60 or more graded items calibrated in a large sample spanning the range of severity; EAP scoring from a normal prior; the most informative item at each step, chosen at random among the best three for exposure, with at least one item from each content area (physical, cognitive, avoidance); stop at SE 0.3 or 12 items; before use, test each item for DIF between the two language versions by ordinal logistic regression or a graded-response likelihood-ratio test matched on the latent score, revise or drop flagged items, and link the two versions through items that function the same.
Notes and sources
Sources
- G. Rasch, Probabilistic Models for Some Intelligence and Attainment Tests (Danish Institute for Educational Research, 1960); F. M. Lord and M. R. Novick, Statistical Theories of Mental Test Scores (Addison-Wesley, 1968), with A. Birnbaum's chapters; F. M. Lord, Applications of Item Response Theory to Practical Testing Problems (Erlbaum, 1980); S. E. Embretson and S. P. Reise, Item Response Theory for Psychologists (Erlbaum, 2000); W. J. van der Linden (ed.), Handbook of Item Response Theory (CRC Press).
- R. D. Bock and R. Lieberman, Fitting a response model for n dichotomously scored items, Psychometrika 35 (1970) 179-197; R. D. Bock and M. Aitkin, Marginal maximum likelihood estimation of item parameters: application of an EM algorithm, Psychometrika 46 (1981) 443-459; D. Rizopoulos, ltm: an R package for latent variable modeling and item response theory analyses, Journal of Statistical Software 17 (2006).
- F. Samejima, Estimation of Latent Ability Using a Response Pattern of Graded Scores, Psychometrika Monograph 17 (1969); G. N. Masters, A Rasch model for partial credit scoring, Psychometrika 47 (1982) 149-174.
- D. J. Weiss (1982); H. Wainer (ed.), Computerized Adaptive Testing: A Primer (2nd edition, 2000); J. B. Sympson and R. D. Hetter (1985) on exposure control; D. Cella et al. (2010) on PROMIS.
- P. W. Holland and D. T. Thayer, Differential item performance and the Mantel-Haenszel procedure, in H. Wainer and H. I. Braun (eds.), Test Validity (Erlbaum, 1988) 129-145; P. W. Holland and H. Wainer (eds.), Differential Item Functioning (1993).
- M. J. Kolen and R. L. Brennan, Test Equating, Scaling, and Linking (3rd edition, Springer, 2014).
- R. J. Mislevy, Randomization-based inference about latent variables from complex samples, Psychometrika 56 (1991) 177-196.
- A. T. Corbett and J. R. Anderson, Knowledge tracing: modeling the acquisition of procedural knowledge, User Modeling and User-Adapted Interaction 4 (1995) 253-278; C. Piech et al. (2015); M. Khajah, R. V. Lindsey and M. C. Mozer (2016); X. Xiong et al. (2016); R. Pelánek, Applications of the Elo rating system in adaptive educational systems, Computers and Education 98 (2016) 169-179.
- W. J. van der Linden, A hierarchical framework for modeling speed and accuracy on test items, Psychometrika 72 (2007) 287-308.
About this partfrom its README
Two pupils of the same ability take different forms of a reading test and score eight and three out of ten. In the 1950s the Danish mathematician Georg Rasch was asked to compare reading across tests that share no items, and modelled the single encounter of one person with one item: the odds of success depend only on ability minus difficulty. Person and item separate, and from that idea come adaptive tests, a statistical definition of an unfair item, national surveys that report populations, and software that tracks what a learner knows.
The viewer watches an adaptive test narrow on Psyche and predicts four numbers. Then the blind spots of classical scores (computed); the Rasch model, specific objectivity and the sufficient sum score, derived and checked on the LSAT; discrimination and guessing, and the LSAT's Rasch and two-parameter fits (matching the published fits); information and the standard error by ability; joint, conditional and marginal estimation, Bock and Aitkin's EM and ability estimates; an adaptive test against fixed forms, and item exposure (computed); the graded response model on attitude items; differential item functioning by Mantel and Haenszel, separating bias from impact (computed); mean-sigma linking (computed); matrix sampling and plausible values with a conditioning model (computed); and knowledge tracing and Elo (computed).
What is computed and built
explainer/psychology/psyche/irt.py: the 3PL model and its information, marginal ML by EM on a quadrature grid (checked by direct maximization and against ltm's published fits), conditional ML through the elementary symmetric functions, EAP and ML abilities, an adaptive test, Samejima's graded response model, Mantel-Haenszel DIF, mean-sigma linking, a conditioning model and plausible values, Bayesian knowledge tracing and Elo. Tested intests/psychology/test_irt.py.explainer/psychology/opendata.pyreads the LSAT and Eurobarometer items from ltm 1.2-0 (CRAN), checked by SHA-256 and never committed.- The Ledger gains two rows.
- The course's interactive: an adaptive test of ten "which is larger?" pairs, chosen one at a time, with the band narrowing; its difficulties are illustrative and nothing is stored.
Chapter notes
| # | Chapter | What it does |
|---|---|---|
| 0 | Different questions, one scale | Two forms, one ability; one person, one item; the question; objectives |
| 1 | On you: an adaptive test, and four numbers | An adaptive test narrowing; four predictions |
| 2 | What classical theory cannot do | Difficulty depends on who answers; one error for everyone? |
| 3 | The Rasch model | One encounter; specific objectivity; the sum score is enough |
| 4 | Two and three parameters | Discrimination and guessing; five law-school items |
| 5 | Information | Fisher information, item by item; what five easy items can measure |
| 6 | Estimation | Three ways to estimate items; Bock and Aitkin's EM; each person's ability |
| 7 | Adaptive testing | Four steps, repeated; the same precision with half the items; the costs |
| 8 | Rating scales | Samejima's graded responses; four items, four discriminations |
| 9 | Fairness as a statistic | A gap is not a bias; Mantel and Haenszel, score by score |
| 10 | Linking and equating | Two years, two forms; mean and sigma; from score to score |
| 11 | Large-scale assessment | Many items, few per student; plausible values |
| 12 | Tracking learning | Bayesian knowledge tracing; one student; Elo and deeper models |
| 13 | The Ledger | Two rows; what they have in common |
| 14 | In practice: exams, clinics and machines | Where it runs; measuring machines |
| 15 | Frontier: time, generated items and learning systems | Three frontiers; open questions |
| Recap, problems, and the road ahead | Your numbers; twelve lines; Kant's three objections; payoffs; problems; references; Part 46 |
NotesWhere the numbers come from
| What | Source |
|---|---|
| The hook: two forms of 10 Rasch items (difficulties -2.5 to 0 and 0 to 2.5); a person of ability 0.5 expects 8.3 and 3.4 | Psyche (irt.prob), item classical |
| Classical blind spots: 10 items (difficulties -2 to 2) answered by 2,000 simulated people of mean -0.7 and 2,000 of mean 0.7; item 5 right for 39% and 69%; the classical SEM (alpha 0.62) against the IRT standard error, 0.74 at the middle and 1.2 at ±3 | Psyche (irt.simulate, irt.fixed_form_se), item classical |
| The LSAT's five items, 1,000 people: proportions correct 0.92, 0.71, 0.55, 0.76, 0.87; Rasch (common slope 0.755) difficulties -3.615, -1.322, -0.318, -1.730, -2.780, log-likelihood -2466.94; two-parameter slopes 0.66 to 0.89, log-likelihood -2466.65; likelihood ratio 0.57 on 4 df (p = 0.97); conditional ML difficulties (centred) -1.256, 0.475, 1.236, 0.168, -0.623 from the 699 people with scores 1 to 4; P(1 1 0 0 0 given a score of 2) = 0.129 at every ability | opendata.lsat_1000 (ltm 1.2-0, fetched from CRAN and SHA-256 checked); Psyche (irt.fit_mml, irt.fit_cml), item lsat; the fits match ltm's |
| EM on the LSAT: log-likelihood -2475.5 after one cycle, -2466.65 after forty; EAP abilities by score -1.91 to 0.63 with posterior SD near 0.8 | Psyche (irt.fit_mml, irt.eap, irt.mle_theta), item em |
| LSAT test information: largest (0.58) at ability -1.75; smallest standard error 1.31 | Psyche (irt.info), item info |
| Adaptive testing: a bank of 300 simulated two-parameter items, 1,000 simulated people: stopping at SE 0.3 takes 17 items on average (RMSE 0.28); the best fixed form needs about 35 items for the same error, a random form about 60; the first item reaches every test-taker | Psyche (irt.cat, irt.eap), item cat |
| Rating scales: four items on science and technology (Comfort, Work, Future, Benefit), 392 people, four categories: discriminations 1.04, 1.23, 2.30, 1.09; thresholds as fitted | opendata.science_attitudes (ltm 1.2-0); Psyche (irt.fit_grm), item grm; the fit matches ltm's |
| DIF: 15 Rasch items, two groups of 3,000 whose means differ by 0.8: on a fair item the proportions correct differ by 0.15 but the Mantel-Haenszel delta is 0.05 (category A); with the item made 0.8 harder for one group, delta -1.85 (category C) | Psyche (irt.mantel_haenszel), item dif |
| Linking: two 30-item forms sharing 10 anchors; this year's group has mean 0.5 and SD 1.2; mean-sigma A = 1.21, B = 0.43; the new items' difficulties off by 0.40 before linking and 0.07 after; true-score equating: 6, 10, 15, 20 and 24 on this year's form equal 6.6, 11.0, 16.1, 20.9 and 24.5 on last year's | Psyche (irt.fit_mml, irt.mean_sigma), item linking |
| Plausible values: 4,000 students, 24 items in 4 booklets of 6, two groups 0.41 apart: SD 1.03 (truth), 0.73 (EAP), 1.02 (plausible values), 1.06 (conditioned); gap 0.22 (EAP), 0.22 (unconditioned plausible values), 0.44 (conditioned) | Psyche (irt.eap, irt.plausible_values, irt.latent_em), item pv |
| Knowledge tracing: 500 simulated students, 10 practices, truth (0.2, 0.15, 0.2, 0.1); fitted (0.18, 0.15, 0.20, 0.09); one student's P(known) passing 0.95 by the fifth practice; Elo difficulties falling with practice | Psyche (irt.bkt_fit, irt.bkt_filter, irt.elo_learn), item bkt |
| Every published number on screen | the studies listed under Sources, quoted as reported |
The diagram of knowledge tracing's two states is schematic; the adaptive test on screen is Psyche's, on a simulated bank.
Notes
| Finding | Original | Status |
|---|---|---|
| An adaptive test reaches the precision of a fixed test with far fewer items, often about half. | Weiss 1982 | replicated |
| A recurrent neural network predicts students' answers far better than Bayesian knowledge tracing. | Piech and colleagues 2015 | replicated, smaller |
Shown without a row, with the reason recorded in explainer/psychology/ledger.py: Rasch; Lord and Novick, and Lord;
Holland and Thayer; van der Linden.
Notes
The web-search budget for this session was spent on earlier parts, so the facts in this part come from the standard literature and were not re-checked online today; each is listed here to be checked against its source: Rasch's 1950s commission (reading tests for Danish schools and the military's intelligence tests) and his 1960 book; the LSAT data's origin as Section 6 of the Law School Admission Test, analysed by Bock and Lieberman (1970); the Eurobarometer items' wording, year (1992) and British sample (as documented in ltm); Birnbaum's chapters in Lord and Novick (1968); Bock and Aitkin (1981); Samejima (1969) and Masters (1982); Weiss (1982) and the "about half" saving; Sympson and Hetter's exposure control; the PROMIS item banks and adaptive forms (Cella et al. 2010); Holland and Thayer (1988) and the ETS A/B/C categories (|Δ| below 1; 1.5 or more and significant); Kolen and Brennan's methods; Mislevy (1991) and plausible values in NAEP and PISA; Corbett and Anderson (1995) and the 0.95 mastery rule; Piech et al.'s AUCs (about 0.86 against 0.67), Khajah, Lindsey and Mozer (2016) and Xiong et al. (2016); van der Linden (2007); the use of item response models for AI benchmarks; and every page range in Sources.
Companion material in this repository
The syllabus's plan for this partfrom SYLLABUS.md, the plan of record
- Hook and On you: a ten-item adaptive test picks each next item from your last answer, and stops when it is sure enough (a demonstration, unscored).
- What classical theory cannot do (Part 3): sample-dependent difficulty, test-dependent scores, one standard error for everyone.
- The Rasch model: P(correct) as a logistic function of ability minus difficulty; specific objectivity; the sum score is sufficient (derived).
- Two and three parameters: discrimination, guessing (Birnbaum; Lord). Item characteristic curves.
- Information: each item informs most near its own difficulty; test information; the standard error as a function of ability (derived as Fisher information; link to Statistics, Built Part 9).
- Estimation: joint, conditional and marginal maximum likelihood by EM; Bayesian ability estimates.
- Adaptive testing: choose the most informative item, update, stop. The same precision in half the items (computed on the Pool); exposure control and item pools.
- Polytomous items: the graded response and partial credit models for rating scales (Part 46).
- Fairness as a statistic: differential item functioning. Matching on ability; Mantel–Haenszel and likelihood- ratio DIF; the difference between item bias and group difference.
- Linking and equating: putting this year's test on last year's scale.
- Large-scale assessment: matrix sampling and plausible values (why a national survey does not give each student a score).
- Tracking learning: Bayesian knowledge tracing (Corbett and Anderson 1995) as a hidden Markov model; Elo for learners and items; deep knowledge tracing against the simple model.
Psyche: psyche.irt: Rasch to 3PL and graded response; marginal ML by EM (reusing statkit.evals' 2PL where it
fits); information functions; a CAT engine; DIF tests; knowledge tracing. Graded on Pool abilities.
On you: the adaptive test on generated matrix items; watch your interval narrow.
Ledger: adaptive tests matching fixed-form precision with fewer items (replicated); deep knowledge tracing's
large gains over simple models (replicated, smaller once baselines were tuned).
In practice: admissions and licensing exams, language tests, clinical short forms, adaptive learning
platforms; evaluating AI systems with IRT (Statistics, Built Part 64).
Frontier: response-time IRT joining Part 25's models to testing; items generated by language models and their
calibration; measurement of rapidly learning systems.
Reading: Rasch 1960; Lord 1980; Lord & Novick 1968 (Birnbaum's chapters); Embretson & Reise 2000; van der
Linden (ed.), Handbook of Item Response Theory; Holland & Wainer (eds.), Differential Item Functioning; Corbett
& Anderson 1995; Mislevy 1991.
Build the film
python -m videos.psychology.psych45.compute # the part's numbers, into .cache/psych45
python tools/build.py psych45 # render and assemble the film
EXPLAINER_TTS=silent python tools/qa_scene.py psych45 Hook # one chapter, silent, with a contact sheet
Scenes: videos/psychology/psych45. Setup: see the course page. Source of these notes: the README and the scenes' narration.
Build it
python -m videos.psychology.psych45.compute # every number (about a minute; fetches the data once)
python tools/qa_scene.py psych45 Cat # one chapter, silent, at 480p, with a contact sheet
EXPLAINER_TTS=silent python tools/build.py psych45 -q l # the whole part, silent preview
python tools/build.py psych45 # 1080p30 with narration
python tools/qa_scene.py psych45 Dif --lang zh # the Chinese edition of one chapter
python tools/make.py psych45 # both editions, with the checks a long build needs
python -m videos.psychology.labs 45 # the lab: LSAT fits, information, CAT, DIF, tracing
python tools/check_ledger.py psych45 # every study shown has its Ledger row, or a reason
python -m pytest tests/psychology # Psyche's irt module, the Ledger, the Archive
The Chinese edition is zh_lines.py (the narration, line by line) and the series table
videos/psychology/psychology_text_zh.json (the text on screen); the terms are in
PSYCHOLOGY_ZH_GUIDE.md.