Tutorials › Generalized Linear Models › Calculating Fitted Category Probabilities

Cumulative Link Models · Tutorial 540 of 981

Calculating Fitted Category Probabilities

Learn to turn fitted cumulative-link model values into a complete, checked probability distribution over the ordered response categories.

Intermediate 9 min read

What You'll Learn

  • Calculate the fitted linear predictor from a covariate value and fitted coefficient.
  • Evaluate cumulative probabilities using the fitted thresholds and link distribution.
  • Recover each category probability by differencing adjacent cumulative probabilities.
  • Check that the category probabilities are nonnegative and sum to one.
  • Recognize how rounding or inconsistent thresholds can signal a calculation problem.

From Fitted Values to Category Probabilities

A fitted cumulative-link model naturally gives probabilities for events of the form “the response is at or below category \(j\).” In many applications, however, the quantity of interest is the probability of each individual response category: for example, the fitted probability of mild, moderate, or severe symptoms. The calculation has two stages: evaluate the fitted cumulative probabilities at the covariate value, then take differences between adjacent cumulative probabilities.

The order of the response categories matters throughout. We use categories \(1,\ldots,K\), in their specified order, and the cumulative probability at cutpoint \(j\) means the probability of category \(j\) or any category below it. Throughout this tutorial, use the cumulative-link convention \(\operatorname{link}\{P(Y\leq j\mid \boldsymbol{x})\}=\alpha_j-\boldsymbol{x}^{\mathsf T}\boldsymbol{\beta}\). The calculations below use the fitted version of this equation.

Definition: For an ordered response with \(K\) categories, let \(\hat{\alpha}_1,\ldots,\hat{\alpha}_{K-1}\) be fitted thresholds, let \(\hat{\boldsymbol{\beta}}\) be the fitted coefficient vector, and let \(\boldsymbol{x}\) be a specified covariate vector. Define the fitted linear predictor as \(\hat{\eta}=\boldsymbol{x}^{\mathsf T}\hat{\boldsymbol{\beta}}\). If \(G\) is the cumulative distribution function associated with the chosen link, the fitted cumulative probabilities are \(\hat{q}_j=G(\hat{\alpha}_j-\hat{\eta})\), for \(j=1,\ldots,K-1\). Set \(\hat{q}_0=0\) and \(\hat{q}_K=1\). The fitted probability of category \(j\) is \(\hat{p}_j=\hat{q}_j-\hat{q}_{j-1}\), for \(j=1,\ldots,K\).

For the cumulative logit model, \(G(z)=1/(1+\exp(-z))\), the logistic cumulative distribution function. For the cumulative probit model, \(G(z)=\Phi(z)\), where \(\Phi\) is the standard normal cumulative distribution function. In either case, first compute \(\hat{\eta}\), then evaluate the cumulative probabilities at the threshold-minus-predictor values, and only then take adjacent differences. The first category uses \(\hat{q}_1-\hat{q}_0=\hat{q}_1\); the last uses \(\hat{q}_K-\hat{q}_{K-1}=1-\hat{q}_{K-1}\).

Worked Calculations

Worked Example: Four Categories in a Cumulative Logit Model

Suppose a fitted model has four ordered response categories and thresholds \(\hat{\alpha}_1=-1\), \(\hat{\alpha}_2=0.5\), and \(\hat{\alpha}_3=1.5\). There is one covariate, with fitted coefficient \(\hat{\beta}=0.8\), and we want probabilities at \(x=0.5\). Calculate all four fitted category probabilities.

First calculate the fitted linear predictor: \(\hat{\eta}=x\hat{\beta}=(0.5)(0.8)=0.4\). The three threshold-minus-predictor values are \(-1-0.4=-1.4\), \(0.5-0.4=0.1\), and \(1.5-0.4=1.1\). For the cumulative logit model, \(G(z)=1/(1+\exp(-z))\), so

$$ \begin{aligned} \hat{q}_1&=G(-1.4)=\frac{1}{1+\exp(1.4)}\approx 0.197816,\\ \hat{q}_2&=G(0.1)=\frac{1}{1+\exp(-0.1)}\approx 0.524979,\\ \hat{q}_3&=G(1.1)=\frac{1}{1+\exp(-1.1)}\approx 0.750260. \end{aligned} $$

Now difference adjacent cumulative probabilities, including the two endpoints:

$$ \begin{aligned} \hat{p}_1&=\hat{q}_1-\hat{q}_0=0.197816-0=0.197816,\\ \hat{p}_2&=\hat{q}_2-\hat{q}_1=0.524979-0.197816=0.327163,\\ \hat{p}_3&=\hat{q}_3-\hat{q}_2=0.750260-0.524979=0.225281,\\ \hat{p}_4&=\hat{q}_4-\hat{q}_3=1-0.750260=0.249740. \end{aligned} $$

All four values are nonnegative. Their sum, using the displayed rounded values, is \(0.197816+0.327163+0.225281+0.249740=1.000000\). Thus the fitted distribution assigns about 19.78%, 32.72%, 22.53%, and 24.97% probability to categories 1 through 4, respectively.

Worked Example: A Negative Fitted Linear Predictor

Consider a three-category cumulative logit model with thresholds \(\hat{\alpha}_1=-0.5\) and \(\hat{\alpha}_2=1.2\), fitted coefficient \(\hat{\beta}=-0.6\), and covariate value \(x=2\). Find the fitted category probabilities.

The linear predictor is \(\hat{\eta}=(2)(-0.6)=-1.2\). Therefore the threshold-minus-predictor values are \(-0.5-(-1.2)=0.7\) and \(1.2-(-1.2)=2.4\). Evaluating the logistic CDF gives

$$ \begin{aligned} \hat{q}_1&=G(0.7)=\frac{\exp(0.7)}{1+\exp(0.7)} \approx \frac{2.013753}{3.013753}=0.668188,\\ \hat{q}_2&=G(2.4)=\frac{\exp(2.4)}{1+\exp(2.4)} \approx \frac{11.023176}{12.023176}=0.916827. \end{aligned} $$

With \(\hat{q}_0=0\) and \(\hat{q}_3=1\), the category probabilities are \(\hat{p}_1=0.668188-0=0.668188\), \(\hat{p}_2=0.916827-0.668188=0.248639\), and \(\hat{p}_3=1-0.916827=0.083173\). They are all nonnegative, and their sum is \(0.668188+0.248639+0.083173=1.000000\). The negative value of the predictor does not change the procedure: it is the specified threshold-minus-predictor expression that is evaluated at each cutpoint.

Worked Example: Three Categories in a Cumulative Probit Model

Suppose a fitted cumulative probit model has thresholds \(\hat{\alpha}_1=-0.5\) and \(\hat{\alpha}_2=0.8\). At the covariate value of interest, the fitted linear predictor is \(\hat{\eta}=0.3\). Calculate the three category probabilities.

The two arguments of the standard normal CDF are \(-0.5-0.3=-0.8\) and \(0.8-0.3=0.5\). Using standard normal CDF values, \(\Phi(-0.8)\approx0.211855\) and \(\Phi(0.5)\approx0.691462\). Hence

$$ \begin{aligned} \hat{q}_1&=\Phi(-0.8)\approx0.211855,\\ \hat{q}_2&=\Phi(0.5)\approx0.691462. \end{aligned} $$

Set \(\hat{q}_0=0\) and \(\hat{q}_3=1\), then difference: \(\hat{p}_1=0.211855-0=0.211855\), \(\hat{p}_2=0.691462-0.211855=0.479607\), and \(\hat{p}_3=1-0.691462=0.308538\). The probabilities are nonnegative and total \(0.211855+0.479607+0.308538=1.000000\), up to the displayed rounding.

Why Differencing Produces a Probability Distribution

The calculation is valid when the cumulative probabilities are ordered. In the usual fitted cumulative logit or probit model, this ordering follows from ordered thresholds: the same predictor is subtracted at every cutpoint, and the link CDF is nondecreasing. The following result states precisely why adjacent differences then form valid category probabilities.

Theorem: Suppose \(\hat{\alpha}_1\leq\cdots\leq\hat{\alpha}_{K-1}\), \(\hat{\eta}\) is finite, and \(G\) is a nondecreasing cumulative distribution function with limits \(G(z)\to0\) as \(z\to-\infty\) and \(G(z)\to1\) as \(z\to+\infty\). Define \(\hat{q}_0=0\), \(\hat{q}_K=1\), and \(\hat{q}_j=G(\hat{\alpha}_j-\hat{\eta})\) for \(1\leq j\leq K-1\). Then \(\hat{p}_j=\hat{q}_j-\hat{q}_{j-1}\) is nonnegative for every \(j\) and \(\sum_{j=1}^{K}\hat{p}_j=1\).

Proof. For each \(j\) from 1 to \(K-2\), ordered thresholds give \(\hat{\alpha}_j-\hat{\eta}\leq\hat{\alpha}_{j+1}-\hat{\eta}\). Since \(G\) is nondecreasing, \(\hat{q}_j\leq\hat{q}_{j+1}\). Also \(0\leq\hat{q}_1\), because CDF values are nonnegative, and \(\hat{q}_{K-1}\leq1\), because CDF values are at most one. Thus the full sequence satisfies \(0=\hat{q}_0\leq\hat{q}_1\leq\cdots\leq\hat{q}_{K-1}\leq\hat{q}_K=1\). Every adjacent difference \(\hat{p}_j=\hat{q}_j-\hat{q}_{j-1}\) is therefore nonnegative. The sum telescopes:

$$ \sum_{j=1}^{K}\hat{p}_j =\sum_{j=1}^{K}(\hat{q}_j-\hat{q}_{j-1}) =\hat{q}_K-\hat{q}_0 =1-0 =1. $$

This proves both claims. \(\square\)

There is also a converse bookkeeping identity: once category probabilities have been computed, summing them up through category \(j\) recovers the cumulative probability at that cutpoint. This is useful both conceptually and as a check on a table of results.

Result: If \(\hat{p}_r=\hat{q}_r-\hat{q}_{r-1}\) for \(r=1,\ldots,K\), then for every \(j=1,\ldots,K-1\), \(\sum_{r=1}^{j}\hat{p}_r=\hat{q}_j\).

Proof. Substitute the definition of each category probability into the sum. The intermediate cumulative terms cancel in adjacent pairs:

$$ \sum_{r=1}^{j}\hat{p}_r =\sum_{r=1}^{j}(\hat{q}_r-\hat{q}_{r-1}) =(\hat{q}_1-\hat{q}_0)+(\hat{q}_2-\hat{q}_1)+\cdots+(\hat{q}_j-\hat{q}_{j-1}) =\hat{q}_j-\hat{q}_0 =\hat{q}_j. $$

The last equality uses \(\hat{q}_0=0\). Thus differencing and cumulative summation reverse one another for these fitted values. \(\square\)

Checks, Rounding, and a Common Pitfall

A practical calculation should include two checks. First, each category probability should be at least zero. Second, the probabilities should sum to one. For a correctly evaluated model with ordered thresholds, these properties follow from the theorem; they are not optional adjustments made after the fact. If an apparent category probability is negative, check the threshold order, the signs in \(\hat{\alpha}_j-\hat{\eta}\), and the order in which the cumulative probabilities were differenced. A negative value is not a probability to report.

For hand calculations, displayed cumulative values are usually rounded. A small discrepancy in the final sum, such as 0.999 or 1.001, can result from rounding intermediate numbers. Keep additional digits while differencing, and round only the final category probabilities. For the final category, calculate \(1-\hat{q}_{K-1}\); this makes its relationship to the upper endpoint explicit. Do not divide all the results by their sum merely to force the rounded total to one, because that can conceal a mistaken cumulative calculation.

  • Pitfall: treating cumulative probabilities as category probabilities. A value such as \(\hat{q}_2=P(Y\leq2\mid\boldsymbol{x})\) includes both categories 1 and 2; it is not the probability of category 2 alone. The correction is \(\hat{p}_2=\hat{q}_2-\hat{q}_1\).
  • Pitfall: changing the sign convention midway. If the fitted cumulative equation uses \(\hat{\alpha}_j-\hat{\eta}\), use that exact argument in \(G\). Substituting \(\hat{\eta}-\hat{\alpha}_j\) without also changing the model convention generally gives different probabilities.
  • Pitfall: omitting an endpoint. The first category is \(\hat{q}_1-0\), and the last is \(1-\hat{q}_{K-1}\). There are \(K-1\) fitted cutpoint cumulatives but \(K\) category probabilities.

The point of this calculation is to express a fitted ordinal model on the scale most directly useful for prediction: a full probability distribution over the response categories at the specified covariate values. Reporting the cumulative values alone leaves that distribution implicit. Showing the differences and the two checks makes the conversion transparent and helps catch arithmetic or convention errors.

Check Your Understanding

Answer each question using the cumulative-link convention and endpoint definitions in this tutorial.

  1. For three response categories with fitted cumulative probabilities \(\hat{q}_1=0.25\) and \(\hat{q}_2=0.70\), calculate all three category probabilities and verify their sum.
  2. In a cumulative logit model, what expression is evaluated inside the logistic CDF when the fitted threshold is \(\hat{\alpha}_j\) and the fitted linear predictor is \(\hat{\eta}\)?
  3. Explain why ordered thresholds imply ordered cumulative probabilities when the same fitted linear predictor is used at every cutpoint.
  4. Suppose computed cumulative probabilities are \(0.6\), \(0.4\), and \(0.8\) at three successive cutpoints. What problem appears when obtaining category probabilities, and what should be checked?
  5. Why is the probability of the last category calculated as \(1-\hat{q}_{K-1}\), rather than as a difference involving another fitted threshold?
Clinical Biostats