Why Form a Within-Subject Log Contrast?
In a crossover study, each subject receives both the test formulation and the reference formulation, usually in different periods. This creates a natural paired comparison: the two measurements belong to the same subject, but correspond to different treatments. Comparing the measurements within a subject can remove a stable subject-level difference in baseline exposure. Taking logarithms makes that cancellation especially clear when baseline differences act multiplicatively on the original scale.
The calculation in this tutorial is a subject-level contrast, not a complete analysis of a crossover study. It does not by itself adjust for period effects, sequence effects, or carryover. The distinction matters: cancellation of a subject baseline is an algebraic property of a paired contrast, whereas interpreting that contrast as a treatment effect also depends on the design and its assumptions.
The endpoint must be measured on a ratio scale for the ratio to be meaningful, and both values must use the same units. For example, \(T_i\) and \(R_i\) might both be AUC measurements in \(\mathrm{ng\cdot h/mL}\). Their ratio has no units, so its logarithm is also dimensionless. A zero or negative measurement cannot be logged; such values require a scientifically justified handling strategy rather than an arbitrary calculation.
Calculating the Subject-Level Contrast
The calculation has two equivalent routes. One may subtract the two natural logarithms, or first divide the test measurement by the reference measurement and then take the natural logarithm. The second route makes the direction of comparison explicit: positive \(d_i\) means \(T_i>R_i\), negative \(d_i\) means \(T_i<R_i\), and \(d_i=0\) means the measurements are equal.
Worked Example: Four Paired Endpoint Measurements
Suppose four hypothetical subjects complete a crossover study, with both AUC measurements expressed in \(\mathrm{ng\cdot h/mL}\). The table reports each subject’s paired reference and test values. The log ratios below are calculated from the unrounded ratios.
| Subject | \(R_i\) (ng·h/mL) | \(T_i\) (ng·h/mL) | \(T_i/R_i\) | \(d_i=\ln(T_i/R_i)\) |
|---|---|---|---|---|
| 1 | 100 | 110 | 1.10 | 0.09531018 |
| 2 | 100 | 90 | 0.90 | −0.10536052 |
| 3 | 200 | 220 | 1.10 | 0.09531018 |
| 4 | 100 | 95 | 0.95 | −0.05129329 |
For subject 1, for example,
The mean of the four individual log ratios is
Back-transforming this mean gives \(\exp(0.00849164)\approx1.00853\), or a geometric mean test-to-reference ratio of about 1.00853 (100.853%). This is a summary of these four paired ratios; it is not a claim that every subject’s ratio is near 1.00853, nor is it an inferential conclusion about a population.
Why the Subject Baseline Cancels
A useful way to understand the contrast is to represent a subject’s measurements on the log scale as a common subject component plus terms that can differ between the two observations. The common component may reflect stable characteristics that make one subject’s exposure generally higher or lower than another’s. The cancellation does not require estimating that component.
where \(b_i\) is the subject-specific baseline on the log scale, \(\tau_T\) and \(\tau_R\) represent treatment-related components, and \(u_{iT}\) and \(u_{iR}\) collect other components of the two observations. Subtracting the second equation from the first gives
Thus the common \(b_i\) disappears. On the original scale, a common baseline multiplier has the same effect. If a subject’s test and reference measurements are both multiplied by \(c_i>0\), then
This is the central justification for forming a within-subject log ratio: a stable multiplicative difference that affects both measurements equally does not affect the contrast. It does not imply that all sources of variability disappear. Measurement error, period-related changes, treatment-by-period effects, and other differences between observations remain in \(d_i\).
Worked Example: The Same Ratio at Different Baseline Levels
Consider two hypothetical subjects whose test measurement is 20% higher than their reference measurement. Subject A has \(R_A=80\) and \(T_A=96\) \(\mathrm{ng\cdot h/mL}\); subject B has \(R_B=200\) and \(T_B=240\) \(\mathrm{ng\cdot h/mL}\). Their reference exposures differ substantially, but their paired ratios are the same:
The larger baseline for subject B changes both of that subject’s measurements by the same factor relative to subject A, but it does not change the within-subject log ratio. This illustrates baseline cancellation when the difference is multiplicative. It does not mean the two subjects have identical pharmacokinetics in every respect; it means their test-to-reference contrasts are identical in this example.
Period Order Is Not Automatically Removed
A crossover pair combines treatment with the periods in which the treatments were received. The subject baseline cancels whether test is given first or second, but a period difference generally does not. A simple hypothetical illustration makes the distinction visible. Suppose the log measurement contains a subject baseline \(b_i\), a test effect \(\delta=\ln(1.10)=0.095310\), and a period-2 contribution of \(0.04\), with no other deviations in this illustration.
Worked Example: A Period Contribution Remains in the Contrast
For a subject receiving test in period 1 and reference in period 2, write the two log measurements as \(\ln(T_i)=b_i+\delta\) and \(\ln(R_i)=b_i+0.04\). Therefore,
For a subject receiving reference in period 1 and test in period 2, the corresponding values are \(\ln(R_i)=b_i\) and \(\ln(T_i)=b_i+\delta+0.04\). This time,
In both cases \(b_i\) cancels, but the period contribution enters with a different sign according to treatment order. These constructed values are not a method for adjusting period effects. They show why a set of subject-level contrasts alone should not be mistaken for a complete crossover analysis.
Assumptions, Checks, and Alternatives
The arithmetic definition of \(d_i\) needs only positive, correctly paired measurements of the same endpoint on a common scale. Its scientific interpretation needs more. The pair must truly represent the same subject under the two formulations; endpoint definitions, units, and transformations must match; and both values must be usable. For interpreting the contrast as reflecting formulation rather than other systematic differences, the crossover design must also be appropriate. In particular, period and sequence features, carryover, and departures from the intended treatment schedule cannot simply be assumed away because a ratio was calculated.
A practical audit should check that each subject has one correctly identified test value and one reference value, that the treatment labels reflect what was actually administered, and that the endpoint values are positive and expressed in the same units. Recalculate a few ratios directly from the source measurements. A sign that is opposite to the expected direction often indicates the ratio was reversed. A contrast of \(\ln(R_i)-\ln(T_i)\) is mathematically valid, but it is the reference-to-test contrast and has the opposite sign; its direction must be stated consistently.
The log difference and the log of the ratio are the same quantity, not competing methods. An unlogged difference \(T_i-R_i\), by contrast, measures an absolute change in endpoint units and does not remove a shared multiplicative baseline. Likewise, calculating separate group summaries and taking their ratio does not preserve the subject-by-subject pairing in the same way. For a full crossover analysis, a model-based approach can represent design factors and within-subject variation; the subject-level ratios are useful contrasts, but they do not replace that analysis.
Another frequent error is to average the individual ratios on the original scale and call that the back-transformed mean log ratio. In general,
which is the geometric mean of the subject-level ratios, not their arithmetic mean. The two summaries can differ, especially when individual ratios vary. The geometric mean ratio has a direct interpretation on the multiplicative scale and corresponds to the average log contrast after back-transformation, as in the earlier material on geometric means and log-scale estimates.
Check Your Understanding
Work each question, then compare your reasoning with the solutions.
- A subject has \(R_i=150\) and \(T_i=135\) \(\mathrm{ng\cdot h/mL}\). Calculate the test-to-reference ratio and its natural log contrast.
- If both measurements for a subject are multiplied by 3, what happens to the subject’s log ratio? Show the calculation.
- Explain why a subject-level contrast can remove a shared baseline but still contain a period contribution.
- For four subjects, the mean of their log ratios is \(0.02\). What is the corresponding geometric mean test-to-reference ratio, approximately?
Solutions. (1) \(T_i/R_i=135/150=0.900\), so \(d_i=\ln(0.900)\approx-0.10536\); the test measurement is 10% lower than the reference for this subject. (2) The ratio is unchanged: \((3T_i)/(3R_i)=T_i/R_i\), and therefore \(\ln((3T_i)/(3R_i))=\ln(T_i/R_i)\). (3) Subtraction removes the same subject term \(b_i\) from both log measurements, but a period term differs according to which treatment was administered in each period, so it need not cancel. (4) The back-transformed summary is \(\exp(0.02)\approx1.0202\), a geometric mean test-to-reference ratio of about 1.020 (102.02%).