From Grouped Counts to a Dose-Response Curve
A dose-response study often records, at each dose, how many subjects experienced a specified outcome and how many were treated. The aim is to describe how the probability of success changes with dose, while retaining the information in both counts. A logistic model provides a smooth curve between the observed dose levels and a direct interpretation of how dose changes the odds.
For dose group \(i\), let \(n_i\) be the number of trials and \(y_i\) the number of successes. The number of failures is \(n_i-y_i\). We model the success count as binomial conditional on the dose: \(Y_i\sim\operatorname{Binomial}(n_i,p_i)\). The model assumes independent groups and a common success probability \(p_i\) for all trials at dose \(i\).
The dose scale matters for interpretation: if one unit of \(x\) represents 10 mg, then \(\beta_1\) describes a 10 mg increase. The fitted probability is a probability for one trial at that dose. The corresponding fitted mean number of successes in a group of \(n_i\) trials is \(n_i\hat p_i\).
Worked Example: Fit a Logistic Curve to Grouped Counts
Worked Example: Fit a Logistic Curve to Grouped Counts
Suppose a study records the number of successful responses among 20 subjects at each dose. Let \(x\) measure dose in units of 10 mg, so \(x=1\) means 10 mg.
| Dose \(x\) | Dose in mg | Trials \(n_i\) | Successes \(y_i\) | Failures \(n_i-y_i\) | Observed proportion |
|---|---|---|---|---|---|
| 0 | 0 | 20 | 2 | 18 | 0.10 |
| 1 | 10 | 20 | 5 | 15 | 0.25 |
| 2 | 20 | 20 | 10 | 10 | 0.50 |
| 3 | 30 | 20 | 15 | 5 | 0.75 |
| 4 | 40 | 20 | 18 | 2 | 0.90 |
For these data, the observed odds at the five doses are \(2/18=1/9\), \(5/15=1/3\), \(10/10=1\), \(15/5=3\), and \(18/2=9\). Their logarithms are \(-2\log 3\), \(-\log 3\), \(0\), \(\log 3\), and \(2\log 3\). They lie exactly on a straight line in dose:
Thus the fitted linear predictor is \(\hat\eta(x)=-2\log 3+x\log 3\). For example, at \(x=1\), the fitted odds are \(\exp(-\log 3)=1/3\), giving fitted probability \((1/3)/(1+1/3)=1/4=0.25\). At \(x=4\), the fitted odds are \(\exp(2\log 3)=9\), giving probability \(9/(1+9)=0.90\). The same calculation at every observed dose reproduces its observed proportion.
This example is constructed so the proportions follow a logistic curve exactly. The likelihood argument below verifies that these coefficients are the maximum-likelihood estimates, rather than merely coefficients that happen to match the table.
Why These Coefficients Maximize the Grouped Likelihood
For independent binomial groups, the likelihood is the product of the group-specific binomial probabilities. Writing \(p_i=\exp(\eta_i)/(1+\exp(\eta_i))\) and \(\eta_i=\beta_0+\beta_1x_i\), its log, including the binomial coefficients, is
The binomial-coefficient terms do not depend on the coefficients, but the terms \(n_i\) do: they encode how many trials contributed to each group. Differentiating with respect to the two coefficients gives the score equations.
In the worked example, at the proposed coefficients the fitted probabilities equal the observed proportions in every group. Therefore \(y_i-n_i\hat p_i=0\) for each \(i\), and both score components are zero. A zero score is a necessary condition for an interior maximum, so we also need to check that it identifies the maximum.
Proof. Differentiating the score again gives the Hessian matrix
For any nonzero vector \(v=(v_0,v_1)^\mathsf{T}\),
Each weight \(n_ip_i(1-p_i)\) is positive because \(n_i>0\) and finite logistic coefficients give \(0<p_i<1\). The spanning condition means that for every nonzero \(v\), at least one \(v_0+v_1x_i\) is nonzero. Hence the displayed sum is strictly negative, and the Hessian is negative definite everywhere. This proves strict concavity. If \(\beta^\ast\) has zero score, then along the line from \(\beta^\ast\) to any different coefficient vector \(\gamma\), the log-likelihood has derivative zero at \(\beta^\ast\) and strictly negative second derivative. Its value at \(\gamma\) is therefore strictly smaller than at \(\beta^\ast\). Thus \(\beta^\ast\) is the unique global maximum. \(\square\)
The five distinct doses in the example satisfy the spanning condition. Since the proposed finite coefficients have zero score, the theorem confirms that they are the unique maximum-likelihood estimates.
Worked Example: Interpret the Dose Coefficient
Worked Example: Interpret the Dose Coefficient
Using the fitted model above, find the odds ratio for a 10 mg increase and for a 20 mg increase. Then compare the probabilities at 0 mg and 20 mg.
A 10 mg increase is one unit of \(x\). The model multiplies the odds by \(\exp(\hat\beta_1)\), so the odds ratio is
A 20 mg increase is two units, so its odds ratio is \(\exp(2\hat\beta_1)=\exp(2\log 3)=9\). At 0 mg, the fitted probability is \(0.10\), with odds \(0.10/0.90=1/9\). At 20 mg, the fitted probability is \(0.50\), with odds \(1\). The odds ratio is \(1/(1/9)=9\), consistent with the two-unit increase. The probability ratio is instead \(0.50/0.10=5\); it is not the odds ratio.
Worked Example: Predict at Doses Between the Observed Levels
Worked Example: Predict at Doses Between the Observed Levels
Use the fitted curve to predict success probabilities at 5 mg and 25 mg. These correspond to \(x=0.5\) and \(x=2.5\).
At 5 mg, the linear predictor is \(-2\log 3+0.5\log 3=-1.5\log 3\). The odds are \(3^{-3/2}=1/(3\sqrt{3})\), so
At 25 mg, the linear predictor is \(0.5\log 3\), so the odds are \(\sqrt{3}\). Therefore
For a group of 20 trials at these doses, the corresponding fitted mean success counts are \(20(0.1614)\approx3.23\) and \(20(0.6340)\approx12.68\). These are expected counts, not claims that a realized count must be fractional.
Using the Fit Carefully
The fitted curve turns grouped counts into a coherent dose-response summary: it estimates probabilities at observed doses and supplies predictions between them. The slope has a constant effect on the log-odds, not a constant effect on probability. The probability change from a dose increment depends on the starting dose, even though the odds ratio for the same increment is constant under this model.
The example's exact agreement between fitted and observed proportions is unusual. With typical data, the proportions will not fall exactly on a logistic curve; the score equations then balance the group residuals \(y_i-n_i\hat p_i\), rather than setting every residual to zero. Groups with different trial totals contribute according to their binomial likelihood, so replacing each group with an equally weighted proportion would discard information about how many trials produced it.
A further practical check is to keep the dose scale visible when reporting results. “Odds multiply by 3 per unit” is incomplete unless the unit is stated. Here it means per 10 mg. Predictions should also be interpreted in the context of the study and the dose range: a mathematically defined curve does not by itself guarantee that predictions far beyond observed doses are scientifically reliable.
Common Mistakes
- Confusing an odds ratio with a probability ratio. A two-unit increase has odds ratio 9 here, but the probability ratio from 0 mg to 20 mg is 5. Compute each quantity from its definition.
- Dropping the trial totals. The response is \(y_i\) out of \(n_i\), not just the proportion \(y_i/n_i\). The binomial likelihood uses both counts.
- Forgetting the dose unit. Since \(x\) is measured in 10 mg units, \(\exp(\hat\beta_1)\) is the odds ratio per 10 mg, not per 1 mg.
- Reporting a predicted count as a probability. At 5 mg, \(0.1614\) is the fitted probability per trial; for 20 trials the fitted mean count is about \(3.23\).
Check Your Understanding
Use the fitted model from the worked example unless a question says otherwise.
- How many failures were observed at the 30 mg dose, and what was the observed success proportion?
- What is the fitted odds ratio for a 30 mg increase? Show how the dose scale enters your calculation.
- Calculate the fitted probability at 20 mg from the coefficients and compare it with the observed proportion.
- At 5 mg, distinguish the fitted success probability from the fitted mean number of successes in 20 trials.
- Why does a zero score establish the unique maximum in this example rather than merely a stationary point?