Why a Dose-Target Confusion Matrix Needs a Precise Question
A dose recommendation may be judged by whether it predicts that a patient will reach a therapeutic target. A confusion matrix summarizes, for the same patients, the predicted classification and the classification based on the observed outcome. Its simplicity is useful, but the table is meaningful only after the target and assessment time have been specified. Changing either can change which patients are counted as attaining the target.
The matrix is a descriptive summary of paired classifications. It does not by itself show how serious a mismatch is, whether the recommendation improves outcomes, or whether a classification rule is clinically appropriate. Those questions require the decision context and consequences of errors, not just the table’s counts.
Define the Two Classifications Before Counting
Suppose the endpoint is a steady-state trough concentration, measured in mg/L, and the target range is 8–12 mg/L, inclusive. A value is classified as attained if it is at least 8 and at most 12; values below 8 or above 12 are classified as not attained. The word “inclusive” matters: exactly 8 and exactly 12 count as attained under this definition.
The predicted classification must also be operationally defined. For a point prediction, apply the same target rule to the predicted endpoint. If a model instead supplies a probability of attainment, a separate probability cutoff is needed to turn that probability into a binary prediction. Do not treat a probability and a binary classification as interchangeable.
Use \(n_{AA}\) for predicted attained and observed attained, \(n_{AN}\) for predicted attained and observed not attained, \(n_{NA}\) for predicted not attained and observed attained, and \(n_{NN}\) for predicted not attained and observed not attained. The first letter always refers to the prediction and the second to the observation. State this convention alongside any table; otherwise row and column labels can be misread.
Here \(N\) is the number of patients with both a usable prediction and a corresponding observed outcome. Overall agreement is the fraction whose predicted and observed labels match:
Agreement is not a measure of the clinical importance of the errors. It gives equal weight to the two off-diagonal types of disagreement, even if underattainment and overattainment have different consequences. It also depends on how often each category occurs in the evaluated group.
Worked Example: Classifying Six Patients Under an Inclusive Range
For six hypothetical patients, a model predicts steady-state trough concentration and a later assessment records the observed steady-state trough. Use the inclusive target range 8–12 mg/L. The predicted and observed values are: A, 9 and 9; B, 7 and 9; C, 6 and 10; D, 10 and 7; E, 8 and 7; F, 9 and 9.
Apply the range rule to each value. A and F are predicted and observed attained. B and C are predicted not attained but observed attained. D is predicted attained but observed not attained. E’s predicted value is exactly 8 mg/L, so it is attained under the inclusive rule; its observed value of 7 mg/L is not attained.
Thus, \(n_{AA}=2\), \(n_{AN}=2\), \(n_{NA}=2\), and \(n_{NN}=0\). The counts sum to \(2+2+2+0=6\), matching the six paired records. The agreement is:
Overall agreement is about 33.3%. This is a statement about these six paired classifications under this target definition and timing. It is not a statement that the model is clinically useful or that it will agree at the same rate in another population.
Why the Target Rule Changes the Table
A target is part of the estimand being evaluated, not a cosmetic label added after predictions are made. A range, a lower-bound threshold, and a target with a different boundary convention define different binary outcomes. Consequently, the same concentration values can produce different cells and different agreement. The target should be chosen for clinical reasons and reported in enough detail to reproduce the classification.
Worked Example: Changing the Lower Boundary
Use the six hypothetical pairs from the preceding example, but now define attainment as a trough from 9 through 12 mg/L, inclusive. The values remain unchanged; only the target definition changes.
A and F are attained in both prediction and observation. B and C have predicted values below 9 and observed values at or above 9, so both are predicted not attained and observed attained. D is predicted attained at 10 but observed not attained at 7. E is predicted not attained at 8 and observed not attained at 7.
The new counts are \(n_{AA}=2\), \(n_{AN}=1\), \(n_{NA}=2\), and \(n_{NN}=1\). The agreement is:
Agreement is now 50.0%, rather than about 33.3% under the 8–12 mg/L target. This difference does not mean the predictions changed: the rule for labelling values changed. Patient E illustrates the boundary effect: a prediction of 8 mg/L attains the first target but not the second.
Probability-Based Predictions Need a Cutoff
Some dosing models provide \(P(\text{attainment})\) rather than a single predicted concentration. A confusion matrix still requires a binary predicted label. One transparent rule is to classify as predicted attained when the model probability meets or exceeds a prespecified cutoff, and as predicted not attained otherwise. The cutoff should be stated; it is not supplied automatically by the probability itself.
Worked Example: Turning Predicted Probabilities into Labels
Consider five hypothetical patients with model-predicted probabilities of attaining the target of 0.82, 0.65, 0.71, 0.40, and 0.20. Their observed outcomes, in the same order, are attained, attained, not attained, not attained, and attained. First use a cutoff of 0.70, classifying probabilities at least 0.70 as predicted attained.
Patients 1 and 3 are predicted attained; patients 2, 4, and 5 are predicted not attained. Comparing those labels with observations gives \(n_{AA}=1\) (patient 1), \(n_{AN}=1\) (patient 3), \(n_{NA}=2\) (patients 2 and 5), and \(n_{NN}=1\) (patient 4). Therefore, agreement is:
If the cutoff is changed to 0.60, patient 2 also becomes predicted attained. The counts become \(n_{AA}=2\), \(n_{AN}=1\), \(n_{NA}=1\), and \(n_{NN}=1\), so agreement is \((2+1)/5=0.600\). The observed outcomes and probabilities did not change; the binary decision rule did. Choosing a cutoff is a decision choice and should not be selected solely because it produces a preferred table.
Align Measurement Timing and the Evaluated Endpoint
A prediction and an observation must refer to the same endpoint at a comparable time. A steady-state prediction should not be compared as if it were a day-7 prediction, and a trough concentration should not be paired with a peak concentration under the same target label. When time or endpoint differs, a disagreement may reflect that mismatch rather than prediction performance for the intended question.
Worked Example: Comparing Matched and Mismatched Assessment Times
For four hypothetical patients, the model predicts steady-state day-14 troughs of 9, 7, 10, and 8 mg/L. Observed day-7 troughs are 7, 6, 8, and 7 mg/L; observed day-14 troughs are 9, 8, 10, and 8 mg/L. Define attainment as at least 8 mg/L, inclusive.
First compare the day-14 predictions with day-7 observations. Patient A is predicted attained but observed not attained; B is predicted not attained and observed not attained; C is attained in both; D is predicted attained but observed not attained. The counts are \(n_{AA}=1\), \(n_{AN}=2\), \(n_{NA}=0\), and \(n_{NN}=1\), giving agreement \((1+1)/4=0.500\).
Now compare the day-14 predictions with day-14 observations. A, C, and D are attained in both. B is predicted not attained at 7 mg/L but observed attained at exactly 8 mg/L. The counts are \(n_{AA}=3\), \(n_{AN}=0\), \(n_{NA}=1\), and \(n_{NN}=0\), giving agreement \((3+0)/4=0.750\).
The two calculations answer different questions because the observed assessment time differs. For evaluating a day-14 prediction of day-14 target attainment, the second pairing is aligned with the stated endpoint and time. The first table can be useful if day-7 performance is the intended question, but it should not be presented as an evaluation of day-14 attainment.
Construction Checks, Alternatives, and Limitations
A reliable construction follows a short sequence: lock the endpoint, target bounds, boundary convention, assessment time, and prediction rule; apply those rules to every eligible patient; then count each paired label exactly once. Check that all four cells are nonnegative integers and that their sum equals the number of complete prediction–observation pairs. If records are missing, state how many were excluded and why; do not silently use different denominators for different parts of the table.
The matrix is complementary to, not a replacement for, other evaluations. Continuous prediction-error summaries retain the magnitude of concentration differences that binary labels discard. Utility or loss analyses can distinguish clinically consequential mismatches from relatively minor ones. The confusion matrix instead makes the direction and frequency of categorical agreement or disagreement visible. No one summary answers all three questions.
A frequent mistake is to read a cell from only one margin. For example, under the inclusive 8–12 mg/L target, patient E has a predicted value of 8 mg/L and an observed value of 7 mg/L. The wrong reasoning is, “The observed value is below target, so E is not attained in both classifications.” The correction is to classify prediction and observation separately: predicted attained, observed not attained, so E contributes to \(n_{AN}\). Boundary checks should be performed on each side of the table.
Other warning signs include totals that do not equal \(N\), reversed row and column conventions, an unreported probability cutoff, or a target chosen after inspecting which rule yields the most favourable agreement. Agreement can also be high when one category is very common, so it should be read alongside the cell counts and the clinical question. A small table is a description of the evaluated records; it does not establish transportability to other patients or settings.
Check Your Understanding
Answer each question using the stated rules. Solutions are included after the questions.
- For the inclusive target 5–10 mg/L, a predicted value is 5 mg/L and the observed value is 10.1 mg/L. Which cell receives the patient?
- A study reports \(n_{AA}=18\), \(n_{AN}=6\), \(n_{NA}=4\), and \(n_{NN}=12\). What is \(N\) and the overall agreement?
- Why must a probability cutoff be reported when predicted attainment is supplied as a probability?
- A day-14 prediction is compared with a day-7 observation. What is the main interpretive concern?
Solutions. (1) The prediction is attained because 5 is an included boundary; the observation is not attained because 10.1 exceeds the upper limit. The patient contributes to \(n_{AN}\). (2) \(N=18+6+4+12=40\). Agreement is \((18+12)/40=30/40=0.750\), or 75.0%. (3) A probability is not itself a binary classification. Different cutoffs can assign different predicted labels and therefore change the cell counts and agreement. (4) The prediction and observation refer to different assessment times, so the comparison may not evaluate the intended day-14 outcome. Use temporally aligned measurements or clearly state that the day-7 outcome is the evaluation target.