Tutorials › Nonlinear Mixed-Effects Models (NLME) › Binning Sparse and Uneven Sampling Designs

Visual and Numerical Predictive Checks · Tutorial 577 of 797

Binning Sparse and Uneven Sampling Designs

Learn practical ways to form stable time bins for sparse or uneven VPC designs without hiding important changes over time.

Intermediate 12 min read

What You'll Learn

  • Distinguish observation counts from the number of contributing subjects in each time bin.
  • Choose between scheduled-time pooling, equal-count bins, and adaptive adjacent-bin merging.
  • Handle tied times and highly uneven sampling without splitting observations at the same time.
  • Use bin widths and within-bin time summaries to check whether pooling hides temporal structure.
  • Apply shared, outcome-independent bin boundaries to observed and simulated records.

Why Sparse Sampling Changes the Binning Problem

A visual predictive check (VPC) compares observed data with replicated data across time. When observations are sparse or concentrated at irregular times, a generic set of equal-width time bins can leave some bins nearly empty and others crowded. Very small bins may yield unstable summaries; very broad bins can combine observations from different parts of a changing concentration-time profile. Binning therefore requires balancing the amount of information in each bin against the temporal detail it retains.

The introductory material on binning time establishes the basic idea of assigning records to time ranges before summarizing them. Here the emphasis is on designs where the nominal sampling schedule has gaps, many records occur at a few times, or subject-level sampling is uneven. The goal is not to make every bin identical. It is to define defensible, reproducible groups that retain useful time resolution and have enough data for the planned summaries.

Definition: Let \(t_{ij}\) be the time of observation \(j\) for subject \(i\). A time bin \(B_k\) is a prespecified interval of time; for example, \(B_1=[c_0,c_1]\) and \(B_k=(c_{k-1},c_k]\) for later bins. The observation count in bin \(k\) is \(n_k=\sum_{i,j} I(t_{ij}\in B_k)\), where \(I(\cdot)\) equals 1 when its condition is true and 0 otherwise. The subject count \(m_k\) is the number of distinct subjects with at least one observation in \(B_k\). These counts answer different questions: \(n_k\) measures the number of records, while \(m_k\) measures how many subjects contribute.

A bin with many records can still represent only a few subjects if some subjects contribute repeated observations there. For that reason, inspect both \(n_k\) and \(m_k\). The appropriate minimum depends on the intended summary and the design; there is no universal count that guarantees a reliable bin. Binning can improve the information available to a summary, but it cannot create independent subjects or recover time points that were not observed.

Rules for Choosing Bins

Start with the sampling design and the purpose of the check. If observations were scheduled at a small number of nominal times, pooling adjacent scheduled times is often easier to interpret than pretending the schedule was continuous. If observation times vary continuously and substantially across subjects, equal-count bins can distribute records more evenly. Adaptive merging is useful when an initial scheme leaves particular bins too sparse. These are tools, not automatic rules: the resulting time ranges and their scientific meaning must still be reviewed.

  • Use the same bin boundaries for observed and simulated records. Define bins from the design or observed times, then apply those boundaries to the corresponding replicate records. Do not let each simulated replicate choose its own bins, because changing boundaries can make comparisons reflect different groupings rather than model behavior.
  • Keep the rule independent of the measured outcome. Choosing boundaries after looking for places where observed and simulated values differ can make the visual check misleading. Time and design features may guide bins; the observed response should not be used to create favorable groupings.
  • Respect ties and scheduled times. If many observations occur at exactly the same time, keep them together. Splitting tied records to force equal counts gives an arbitrary partition and can make the same sampling time appear in multiple bins.
  • Check time width as well as count. Equal-count bins can be very narrow where sampling is dense and very wide where it is sparse. A wide bin may combine distinct phases of a profile, so record its time range and a representative time such as the median observed time.
  • Consider subject contribution. A bin with a high record count but very few distinct subjects may provide less between-subject information than the record count suggests. Examine subject IDs, not just a histogram of records.

For quantile summaries, small bins also have limited rank resolution. If the empirical quantile at probability \(p\) is defined by the ordered observations \(y_{(1)}\leq\cdots\leq y_{(n_k)}\), one common convention selects the observation with rank \(\lceil n_kp\rceil\), subject to the software’s interpolation rule. With \(n_k=10\), a 5th-percentile rank is \(\lceil 10(0.05)\rceil=1\): the result is controlled by the smallest observation. Increasing the bin count improves rank resolution, though clustered repeated observations still require attention to the number of subjects. This is a practical reason to avoid bins that are too sparse, not a guarantee that a particular minimum count is adequate.

Worked Example: Pooling Adjacent Scheduled Times

Suppose a hypothetical study has observation counts of 3, 4, 2, 3, and 2 at scheduled times 0.5, 1, 2, 4, and 8 hours, respectively. The team wants at least 5 records per bin as a working design target for this example. This is a chosen planning target, not a universal standard. To keep bins contiguous in time, start at the earliest time and pool adjacent scheduled times until the target is met.

The first two times give \(3+4=7\) records, so they form one bin: 0.5–1 hour. The next two times give \(2+3=5\) records, so they form a second bin: 2–4 hours. The final time has only 2 records, so it cannot stand alone under the stated target. Merge it with the preceding bin: the 2–8-hour bin then contains \(2+3+2=7\) records. The final bins therefore have counts 7 and 7, with ranges 0.5–1 and 2–8 hours.

The arithmetic meets the record-count target, but it does not settle whether the 2–8-hour bin is useful. It spans a six-hour interval. If the profile is expected to change rapidly between 2 and 4 hours, pooling that interval with 8 hours may obscure the pattern. Review the time range, the distinct-subject count, and the intended interpretation before accepting the grouping. If this wide bin is not defensible, the honest alternative may be to show that a late bin is sparse rather than imply that the design supports a stable summary there.

Equal-Count Bins, Ties, and Adaptive Merging

When sampling times are irregular rather than concentrated at a short list of scheduled occasions, equal-count bins can distribute records more evenly. A straightforward procedure sorts the times and selects cutpoints near the desired record counts. If multiple records share a time, however, the cutpoint should be moved to keep those tied observations together. The resulting bins may not have equal counts, and their widths can vary considerably. Report the actual counts and ranges rather than describing them as equal-sized in every respect.

Adaptive merging begins with candidate bins and combines adjacent bins that fail a prespecified adequacy rule. The rule might consider both record and subject counts, but should also impose a maximum acceptable time span or require that bins not cross a known design boundary. Merging only adjacent bins preserves time order. Merging distant bins merely because their counts are small can combine unrelated portions of a profile.

Worked Example: Forming Equal-Count Bins Without Splitting Ties

Consider these 12 hypothetical observation times in hours, listed in order: 0.2, 0.3, 0.4, 0.5, 1, 1, 1.2, 2, 4, 4.5, 5, and 8. Three bins of about four records each are desired. A simple equal-count split after records 4 and 8 would put the first four times in bin 1 and the next four in bin 2. No tied time is split in this particular list, so the boundaries can be placed between 0.5 and 1, and between 2 and 4.

The resulting bins are 0.2–0.5 hours, containing 4 records; 1–2 hours, containing 4 records; and 4–8 hours, containing 4 records. Their median times are 0.35, 1.1, and 4.75 hours. Although the counts match, the ranges are not equally wide: the first spans 0.3 hours, while the last spans 4 hours. Thus equal counts help avoid an empty late bin, but they do not mean that time is represented with equal resolution. If, instead, a tied time of 1 hour straddled a proposed cutpoint, move that cutpoint so both records at 1 hour remain in the same bin, accepting unequal bin counts.

Before using these bins, check whether the gap from 2 to 4 hours, or the broad 4–8-hour bin, crosses an important change in the profile. If so, a different grouping or an explicit display of sparse data may be more informative than insisting on exactly four records in every bin.

Justification for adjacent merging: Suppose an initial ordered partition has bins \(B_1,\ldots,B_K\), and bin \(B_k\) fails a prespecified minimum-count rule. Merging it with an adjacent bin replaces two counts \(n_k\) and \(n_{k+1}\) by \(n_k+n_{k+1}\), so the record count cannot decrease. It also replaces their time ranges by the union of those ranges, which is wider or unchanged. Thus merging directly addresses sparsity, but necessarily sacrifices or preserves—not improves—time resolution. This count-and-resolution trade-off is why merging should be reviewed for temporal meaning rather than continued mechanically.

Worked Example: Checking Subject Counts Before Accepting a Merge

Suppose five adjacent hypothetical time ranges have the following record counts and numbers of distinct subjects: (8 records, 7 subjects), (6, 5), (3, 3), (2, 2), and (1, 1). For illustration, assume an audit of subject IDs confirms that the first two ranges have 11 distinct subjects combined, while the last three ranges have 6 distinct subjects combined. The target is at least 5 subjects per bin.

The first two ranges already meet the target separately: their subject counts are 7 and 5. The third through fifth ranges do not, so merge these adjacent ranges. The combined late bin has \(3+2+1=6\) records. Its subject count is not obtained by blindly adding the three separate subject counts; it is 6 because the IDs were checked and the union contains 6 distinct subjects. The final grouping has subject counts 7, 5, and 6, so all meet the stated target.

The target is met, but the late bin covers three original ranges. If the interval is too broad to represent a meaningful time region, the design may not support the desired subject count at that resolution. State that limitation rather than treating the merged bin as evidence about a precise late time. If subject IDs had overlapped across the ranges, the combined subject count could be lower than \(3+2+1\); calculating it from distinct IDs is essential.

Diagnostics, Alternatives, and Limitations

Before interpreting a binned check, make a bin audit. For each bin, record its boundaries, observation count \(n_k\), distinct-subject count \(m_k\), observed time range, and a representative time such as the median. Inspect the distribution of times within each bin, not only its total count. A long gap inside a bin or a sharp change in sampling density can reveal that the bin is concealing more than its summary communicates. Also verify that observed and simulated records use the intended common boundaries and that any records absent from the analysis have a documented reason.

ApproachUseful whenMain risk to check
Pool adjacent scheduled timesThe design uses a small number of nominal visits and nearby visits can be interpreted together.A bin may become too wide, especially at late times.
Equal-count binsObservation times vary continuously and sparse regions would otherwise have very few records.Widths can vary greatly; tied times must remain together.
Adaptive adjacent mergingAn initial time-based scheme leaves specific bins below a prespecified count target.Repeated merging can erase temporal detail or cross meaningful boundaries.
Keep sparse bins visibleThere is no defensible way to pool sparse observations without distorting the time pattern.Summaries may be unstable, so the limitation must be made clear.

Binning is a design choice, not a cure for sparse data. Counts do not account fully for dependence among repeated observations, missing data, or differences in which subjects contribute at different times. A bin may contain enough records yet represent an unusual subset of subjects. Nor is there a single binning rule that is best for every sampling schedule. When multiple reasonable rules produce materially different time groupings, that sensitivity is itself useful information: present or document the alternatives rather than selecting one solely because its display looks smoother.

A common mistake is to say, “The early bin has too few records, so I will widen it until the summary looks stable,” and then to ignore the widened range. The correction is to define an outcome-independent count rule, merge only in time order, and report the resulting boundaries and counts. Then ask whether the broader bin still represents a meaningful time region. More records can reduce sparsity while simultaneously obscuring a time trend; both consequences must be judged.

Key takeaway: Choose bins using the sampling design and a stated count-and-resolution rule. Check both records and distinct subjects, keep tied times together, use shared boundaries for observed and simulated data, and do not hide an irreducibly sparse region by pooling across an uninformative time span.

Check Your Understanding

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

  1. A bin contains 18 records from 3 subjects. Why is “18 observations” not a complete description of the information in that bin?
  2. Four adjacent scheduled times have counts 2, 3, 1, and 4. With a working target of at least 5 records, give one contiguous grouping that meets the target.
  3. In an equal-count scheme, several observations share the proposed cutpoint time. What should you do, and why?
  4. Why should observed and simulated records use the same bin boundaries?
  5. A late bin reaches the minimum count only after combining three widely separated time ranges. What should you assess before accepting it?

Solutions. (1) The 18 records come from only 3 distinct subjects, so repeated observations may contribute many records without representing many independent subjects. Report both counts. (2) Pool the first two times, giving \(2+3=5\), and the last two, giving \(1+4=5\). Both bins are contiguous and meet the target. (3) Keep all records at the tied time in the same bin. Splitting them would arbitrarily assign observations from one sampling time to different bins. The bin counts may therefore differ from the target. (4) Shared boundaries make the observed and simulated summaries refer to the same time regions; otherwise differences could arise from different groupings. (5) Check the full time span, gaps, subject counts, and whether the ranges cross a meaningful change in the profile. If the bin is too broad to be interpretable, show the sparsity or choose another defensible display rather than implying precise time resolution.