Tutorials › Population Pharmacokinetics › Time-Binned Concentration Medians and Quantiles

Exploratory Data Analysis · Tutorial 61 of 599

Time-Binned Concentration Medians and Quantiles

You will learn to construct time-binned concentration summaries, choose and report binning and quantile conventions, and recognize when uneven sampling limits interpretation.

Intermediate 10 min read

What You'll Learn

  • Define nonoverlapping time bins with explicit edges and boundary rules.
  • Calculate medians and quartiles using a stated empirical quantile convention.
  • Display bin-level summaries with sample counts and clear time locations.
  • Explain how unequal sampling times and numbers of records per subject can affect pooled summaries.
  • Distinguish descriptive quantiles from confidence intervals and model-based estimates.
  • Diagnose sparse bins, boundary sensitivity, and misleading trends.

Why Summarize Concentrations by Time Bin?

A concentration-time data set can contain many observations at irregular times. A plot of every record is useful for seeing the data directly, but overlapping observations can make the broad pattern difficult to read. A time-binned plot offers a compact description: it groups observations into time intervals and displays a median concentration and selected quantiles for each interval.

These summaries describe the concentrations recorded in each bin. They do not, on their own, estimate a typical subject’s entire concentration profile, establish a pharmacokinetic model, or explain why concentrations differ. Their interpretation depends on which records enter each bin, how the bins are defined, and how sampling is distributed within them.

Definition: A time bin is a specified interval of time used to group concentration observations. For a bin \(B_j\), the pooled median is the median of all recorded concentrations whose observation times fall in \(B_j\). A pooled quantile at probability \(p\) is the corresponding empirical quantile of those same concentrations. “Pooled” means that records are grouped by time bin, not first reduced to one summary per subject.

Define Bins and Quantiles Before Plotting

Write down the bin edges and boundary rule before calculating summaries. One common choice is left-closed, right-open bins, such as \([0,1)\), \([1,2)\), and \([2,3)\) hours. An observation exactly at 1 hour then belongs to \([1,2)\), not \([0,1)\). The final bin can be defined to include its upper boundary if needed. Explicit rules prevent a record on an edge from being omitted or counted twice.

For a bin with \(n\) concentrations, sort the values as \(x_{(1)} \leq \cdots \leq x_{(n)}\). This tutorial uses the type 7 empirical quantile convention. For probability \(p\), set \(h=1+(n-1)p\), \(j=\lfloor h \rfloor\), and \(\gamma=h-j\). When \(h\) is an integer, \(Q(p)=x_{(j)}\); otherwise, \(Q(p)=(1-\gamma)x_{(j)}+\gamma x_{(j+1)}\). In particular, \(Q(0.5)\) is the median, including the average of the two middle observations when \(n\) is even.

$$ h=1+(n-1)p,\qquad Q(p)=(1-\gamma)x_{(j)}+\gamma x_{(j+1)} $$

Here \(j=\lfloor h \rfloor\) and \(\gamma=h-j\); if \(h\) is an integer, use \(Q(p)=x_{(j)}\). Other software may use another sample-quantile convention, especially in small bins. State the convention and use it consistently so a reader can reproduce the summaries.

A common display shows the median as a point or line and the 25th and 75th percentiles as the lower and upper ends of a vertical bar. These quartiles describe the middle half of the observed concentrations in that bin. They are not confidence limits for a population parameter. A time location such as the bin midpoint can be used to position each summary, but the plotted summary still represents all records in the interval, not observations taken exactly at that midpoint.

Worked Example: Calculate Medians and Quartiles in Three Bins

Suppose a hypothetical study records concentrations in mg/L. After assigning observations to three prespecified time bins, the concentrations in the bins are: \([0,1)\) hour: 2, 4, 6, 8, 10; \([1,2)\) hours: 1, 3, 5, 7; and \([2,3]\) hours: 0.8, 1.2, 2, 4, 6. Calculate the median and quartiles in each bin using the type 7 convention.

First bin. The sorted values are 2, 4, 6, 8, 10, so \(n=5\). For \(p=0.25\), \(h=1+4(0.25)=2\), giving \(Q(0.25)=4\). The median is \(x_{(3)}=6\), and for \(p=0.75\), \(h=4\), giving \(Q(0.75)=8\). The summary is 4, 6, and 8 mg/L.

Second bin. The sorted values are 1, 3, 5, 7, so \(n=4\). For the lower quartile, \(h=1+3(0.25)=1.75\), so \(j=1\) and \(\gamma=0.75\). Thus \(Q(0.25)=1+0.75(3-1)=2.5\) mg/L. The median is \((3+5)/2=4\) mg/L. For the upper quartile, \(h=3.25\), so \(Q(0.75)=5+0.25(7-5)=5.5\) mg/L.

Third bin. The sorted values are 0.8, 1.2, 2, 4, 6, so \(n=5\). The quartile ranks are 2 and 4, and the median rank is 3. The summaries are therefore 1.2, 2, and 4 mg/L. A plot can display these three median points with bars extending from the lower to the upper quartile, accompanied by bin-specific counts of 5, 4, and 5 records.

How to Build and Read the Plot

A reliable workflow keeps the grouping and the plotted meaning visible. The summaries should be calculated from the analysis records that meet the stated inclusion rules, with concentration units and time origin made clear. Bins should be chosen to balance resolution against the number of observations available for each summary. Very narrow bins can be empty or unstable; very wide bins can conceal changes within the interval.

1
Specify the time scale and bins.
State the time origin, units, bin edges, and boundary convention. Use the same rules for every record.
2
Assign records and check counts.
Assign each eligible concentration observation to exactly one bin. Record the number of observations in each bin and identify empty or sparse bins.
3
Calculate the summaries.
Sort concentrations within each bin and calculate the median and chosen quantiles using one declared convention.
4
Plot with context.
Show the median and quantile range at a clearly identified bin location. Label the axes with units and report counts, bin edges, and the quantile convention in a caption or legend.

A declining sequence of bin medians means that the median of the recorded concentrations is lower in later bins than in earlier bins. It does not establish that every subject’s concentration declined over that period. Nor does a wide interquartile range reveal whether variation is mainly within subjects, between subjects, or both. Those are different questions from the pooled, time-binned description.

Worked Example: Uneven Records Can Change a Pooled Median

Consider a hypothetical 1-to-2-hour bin. Subject A contributes five observations, with concentrations 2, 4, 6, 8, and 10 mg/L, mostly near the beginning of the bin. Subjects B and C each contribute one observation near the end, at 20 and 22 mg/L. What does the pooled median show, and how does it differ from a summary that gives each subject equal weight?

The pooled sorted values are 2, 4, 6, 8, 10, 20, 22 mg/L. There are seven records, so the median is the fourth value: 8 mg/L. For the 25th percentile, \(h=1+6(0.25)=2.5\), giving \(Q(0.25)=4+0.5(6-4)=5\) mg/L. For the 75th percentile, \(h=1+6(0.75)=5.5\), giving \(Q(0.75)=10+0.5(20-10)=15\) mg/L.

The pooled result gives five of its seven records to Subject A. By contrast, the three subject-specific medians are 6, 20, and 22 mg/L; their median is 20 mg/L. These are different summaries of different targets. The pooled median describes the middle recorded concentration when records are pooled. The median of subject medians describes the middle subject-specific median among these three subjects. Neither is automatically the appropriate summary for every question.

If the plot is intended to describe recorded concentrations in the bin, the pooled median is coherent, but the unequal record contribution must be visible or acknowledged. If the intended target is a typical subject-level summary, a subject-level approach may be more suitable, with its definition stated explicitly. The plot alone cannot resolve that choice.

Bin Choice, Diagnostics, and Alternatives

Binning necessarily trades detail for readability. A change in bin width or placement can change which observations are grouped together and therefore change the plotted medians and quantiles. This sensitivity is especially important when sampling times are uneven within a bin: observations concentrated near one edge may dominate a summary that is positioned at the bin midpoint.

Several checks help reveal problems before interpretation:

  • Show counts. A median based on two records is much less informative about the distribution in that interval than a median based on many records. Counts also make gaps in sampling visible.
  • Check where observations fall within bins. A histogram, rug, or tabulation of actual sampling times can show whether records cluster at one edge rather than spanning the interval.
  • Inspect sensitivity to reasonable bin definitions. If the apparent pattern changes materially with modest shifts in bin edges or width, describe that instability rather than presenting one grouping as definitive.
  • Retain a view of the raw observations. A bin summary can hide outliers, gaps, and multiple clusters. Compare it with a concentration-versus-time scatter plot when interpreting the pattern.
  • State how special records were handled. For example, observations below a quantification limit require an explicit, consistent rule; replacing them with zero without justification can distort the summaries.

A raw scatter plot preserves each observation and its actual time, but may be visually dense. A binned median-and-quantile plot is more compact, but discards within-bin timing detail and depends on bin definitions. A smooth curve can show gradual patterns without sharp bin boundaries, but introduces choices about the smoothing method and can obscure local data coverage. Mean-and-standard-deviation summaries answer a different descriptive question and can be more sensitive to extreme concentrations. These displays are complements, not interchangeable evidence.

Common pitfall: “The median point is plotted at 1.5 hours, so it describes the median concentration at exactly 1.5 hours.” This is not justified when the point summarizes all records in a bin such as \([1,2)\) hours. The midpoint is only a plotting location; label or caption the bin interval and interpret the point as a summary of observations within that interval.

Time-binned medians and quantiles are useful for communicating broad concentration patterns while keeping the display interpretable. Their strength is descriptive simplicity, not adjustment for study design or unequal sampling. A clear plot therefore reports the binning rules, the number of records, the quantile convention, and enough information to judge whether observations adequately represent the time intervals being summarized.

Worked Example: Apply a Boundary Rule and Calculate the Summaries

In a hypothetical data set, the time-concentration pairs are \((0.2,10)\), \((0.9,8)\), \((1.0,6)\), \((1.8,4)\), \((2.1,2)\), and \((2.9,1)\), with time in hours and concentration in mg/L. Use bins \([0,1)\), \([1,2)\), and \([2,3]\). Assign the boundary observation at 1.0 hour and calculate the median and quartiles in each bin.

Under the left-closed, right-open rule, the 1.0-hour observation enters \([1,2)\). The concentrations in \([0,1)\) are 8 and 10; in \([1,2)\), they are 4 and 6; and in \([2,3]\), they are 1 and 2 mg/L.

Each bin has \(n=2\). For the first bin, the type 7 lower quartile has \(h=1+1(0.25)=1.25\), so \(Q(0.25)=8+0.25(10-8)=8.5\) mg/L. The median is \((8+10)/2=9\) mg/L, and the upper quartile is \(8+0.75(10-8)=9.5\) mg/L. Applying the same calculation gives 4.5, 5, and 5.5 mg/L in the second bin, and 1.25, 1.5, and 1.75 mg/L in the third.

The sequence of medians is 9, 5, and 1.5 mg/L. It summarizes these six records in the three specified bins. Because each summary uses only two observations, the quantile ranges are highly limited descriptions of the concentrations in their intervals; the plotted decline should not be treated as a precise estimate of the concentration trajectory.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. For the sorted concentrations 3, 5, 9, and 11 mg/L in one bin, calculate the median using the stated convention.
  2. If an observation occurs exactly at 2 hours and bins are \([0,2)\) and \([2,4)\), which bin contains it?
  3. A bin contains 12 records from one subject and one record from each of two other subjects. What feature of a pooled median should be kept in mind?
  4. Why is a quartile range from a time-binned plot not a confidence interval for the median?

Solutions. (1) With four values, the median is the average of the middle two: \((5+9)/2=7\) mg/L. (2) It belongs to \([2,4)\), because the lower boundary is included and the upper boundary is excluded. (3) The pooled summary gives most weight in the record count to the first subject; it describes pooled records, not an equally weighted typical subject. Report counts and consider whether that pooled target matches the question. (4) The quartiles describe the spread of observed concentrations in the bin. They are not calculated to quantify sampling uncertainty in the median, so they should not be interpreted as a confidence interval.

Clinical Biostats