Tutorials › Optimal Design and Model-Informed Dosing › Encoding Candidate Sampling Designs

Simulation Studies of Designs · Tutorial 442 of 497

Encoding Candidate Sampling Designs

Represent each candidate design as explicit subject allocations and dose-anchored sampling schedules, then verify that its encoded records match the design’s intended timing and structure.

Intermediate 10 min read

What You'll Learn

  • Define a candidate sampling design as schedules plus rules assigning subjects to those schedules.
  • Distinguish nominal sampling times from realized observations and missing records.
  • Calculate planned sample counts for full-profile and sparse-sampling designs.
  • Encode fixed, stratified, and probabilistic schedule allocations consistently.
  • Diagnose common design-encoding errors involving time anchors, units, and allocation totals.
  • Compare alternative representations and identify when each is useful.

Why the Design Must Be Explicit

A simulation can generate plausible drug concentrations and still answer the wrong design question if its records do not reflect the proposed sampling plan. For example, a schedule with six samples per participant is not equivalent to one with three, even if both schedules contain the same early and late time points across the study as a whole. The simulation must encode not only which times are considered, but also which participant is scheduled at each time.

The task here is to represent candidate sampling designs: the planned sampling times, the number of participants assigned to each schedule or group, and any rule that determines that assignment. A sampling design specifies intended collection. Whether a scheduled sample is ultimately observed is a separate issue: the schedule should remain identifiable even when a simulated record has a missing observation.

Definition: A candidate sampling design \(D\) is a specification of (1) the eligible sampling times and their time anchors, (2) the number of participants or sampling units assigned to each schedule, and (3) the allocation rule used to assign those units. For participant \(i\), let \(A_i(D)\) denote the set of nominal sampling times assigned by \(D\). A scheduled sample is one time-point in \(A_i(D)\), whether or not a usable observation is later recorded.

The definition assumes that the simulation’s sampling unit is identified (usually a participant), that each time is defined relative to a stated anchor, and that the allocation rule can be applied to the simulated participants. If timing depends on dosing, for instance, “2 hours” must mean 2 hours after a specified dose, not simply 2 hours after an unspecified study start. A design can instead use clock time or time after an event, provided that event and its timing are defined consistently.

A useful representation separates a schedule table from a participant allocation table. The schedule table lists the nominal times in each schedule. The allocation table lists how many participants, or which simulated participants, receive each schedule. This avoids repeating timing information for every person while preserving the link between an individual and their planned samples.

Counting Planned Samples

For a fixed design, suppose there are \(G\) allocation groups. Group \(g\) has \(n_g\) participants and schedule \(A_g\), containing \(m_g\) distinct nominal sampling times per participant. If every participant in that group receives that schedule, the total number of planned sample records is

$$ S_{\mathrm{planned}}=\sum_{g=1}^{G} n_g m_g. $$

This count is a structural check on the encoded design. It is not the number of usable observations: realized records may have fewer observed values because of missingness or other processes represented separately. The formula assumes one planned sample per participant at each listed time. If the protocol schedules multiple samples at the same nominal time on different occasions, represent occasions separately so they are counted correctly.

Encoding principle: Store the schedule and the allocation as separate, linked parts of the design. For every simulated participant, the encoded design should determine a well-defined set of nominal times and should not silently create, omit, or duplicate planned samples.

Worked Examples

Worked Example: Full Profiles in Three Study Groups

Consider a hypothetical study with 60 participants divided equally among three groups. Every participant is scheduled for samples at 0.5, 1, 2, 4, 8, and 12 hours after a specified dose. Calculate the planned sample count and describe a compact encoding.

Each group has \(n_g=60/3=20\) participants. Each participant has \(m_g=6\) scheduled samples. Thus,

$$ S_{\mathrm{planned}}=3(20)(6)=360\text{ samples}. $$

A schedule table can define one schedule, say “full,” with times \(\{0.5,1,2,4,8,12\}\) hours after dose. An allocation table can then assign 20 participants in each group to that schedule. The group label and schedule assignment are distinct fields: the group identifies the study group, while the schedule identifies planned sampling times.

The calculation is correct if the protocol intends one sample at each listed time for every participant. If predose sampling is also planned, it must be added as a distinct nominal time, making \(m_g=7\) and the total \(3(20)(7)=420\) planned samples.

Worked Example: Sparse Sampling With Four Patterns

A hypothetical 48-participant study uses four sparse schedules, assigning exactly 12 participants to each. The schedules are: A: 0.5, 2, and 8 hours; B: 1, 4, and 12 hours; C: 0.5, 4, and 12 hours; D: 1, 2, and 8 hours after dose. Find the planned total and the number of scheduled samples at each nominal time across participants.

Every schedule contains three times, so each contributes \(12(3)=36\) planned samples. Therefore,

$$ S_{\mathrm{planned}}=4(12)(3)=144\text{ samples}. $$

Count each time across the schedule patterns: 0.5 hours appears in A and C, so \(2(12)=24\) participants are scheduled then. One hour appears in B and D, also \(24\). Two hours appears in A and D, also \(24\); 4 hours appears in B and C, also \(24\); 8 hours appears in A and D, also \(24\); and 12 hours appears in B and C, also \(24\).

There are six distinct nominal times, with 24 participants scheduled at each, giving \(6(24)=144\) scheduled samples, consistent with the schedule-based count. That agreement is a useful check, but it does not imply that every participant has all six times: each participant has only three.

Worked Example: Allocation by a Prespecified Stratum

A hypothetical design enrolls 60 participants and assigns sampling schedules within two renal-function strata determined at enrollment. The protocol sets a quota of 30 participants per stratum. Participants in stratum 1 receive a four-time schedule; those in stratum 2 receive a three-time schedule. Calculate the planned sample total and identify what must be encoded.

For stratum 1, the contribution is \(30(4)=120\) samples. For stratum 2, it is \(30(3)=90\). Hence,

$$ S_{\mathrm{planned}}=30(4)+30(3)=120+90=210\text{ samples}. $$

The encoding needs the stratum definition, the quota for each stratum, and the schedule linked to each stratum. The rule must also state what happens if the simulated enrollment process does not produce enough participants in a stratum to meet its quota. One option is to construct the simulated cohort to contain exactly 30 in each stratum; another is to define a recruitment or replacement rule. Leaving this unspecified means the allocation rule is not fully encoded.

The 30/30 allocation is a design choice, not necessarily a representation of the population proportions. If the aim is to evaluate performance in each stratum, equal quotas may be intentional even when the underlying population is not equally divided. Any later overall summary would need to reflect its stated target population; the sampling allocation alone does not determine that target.

Fixed Counts and Allocation Rules

A design may specify exact counts, such as 12 participants per sparse schedule, or a rule that assigns schedules probabilistically. For a probabilistic rule, define the eligible participant information, the possible schedules, and the assignment probabilities before generating the assignments. If there are \(J\) schedules, their probabilities \(q_1,\ldots,q_J\) must satisfy \(q_j\geq 0\) and \(\sum_{j=1}^{J}q_j=1\). A simulated cohort may then have realized schedule counts that differ from their expected counts.

For example, if each participant is independently assigned to schedule A with probability 0.6 and schedule B with probability 0.4, then among 50 participants the expected counts are 30 and 20. These are expectations, not guaranteed quotas. If the design instead requires exactly 30 on A and 20 on B, encode a fixed-count allocation, not independent assignments with those probabilities. The two procedures can yield different simulated designs.

Allocation may also be stratified: the assignment rule is applied within levels of a prespecified variable. State whether quotas are fixed within strata or whether probabilities apply within strata, and identify which participant information is available when assignment occurs. If schedule choice depends on a measured outcome that is generated later, it is not a baseline allocation rule; it would require an explicitly defined sequential design.

Justification: Why the Count Check Works

The total planned sample count follows by partitioning the participants according to their assigned schedule. In group \(g\), each of \(n_g\) participants contributes exactly \(m_g\) scheduled records, so the group contributes \(n_gm_g\). The groups do not overlap and together include all assigned participants. Adding their contributions gives the total:

$$ S_{\mathrm{planned}} =\underbrace{n_1m_1}_{\text{group 1}} +\underbrace{n_2m_2}_{\text{group 2}} +\cdots+ \underbrace{n_Gm_G}_{\text{group }G} =\sum_{g=1}^{G}n_gm_g. $$

This derivation also shows the assumptions behind the check: every participant belongs to one group, each group has a defined schedule, and every listed time contributes one planned record per participant. If schedules vary within a group, split that group into schedule-specific groups or calculate the number of times individually as \(\sum_i |A_i(D)|\). Do not apply the group formula with one \(m_g\) when participants in that group actually have different numbers of scheduled times.

Practical Encoding and Diagnostics

A robust design representation should make it possible to reconstruct every participant’s planned samples without guessing. A long-format schedule table can use one row per schedule-time pair, with fields for schedule identifier, occasion, nominal time, time unit, and anchor. A separate allocation table can contain participant identifier, stratum or group, and schedule identifier. Alternatively, a participant-level record can store an explicit list of times; this can be convenient for small designs but harder to audit for many patterns.

Before using an encoded candidate design, check the following:

  • Allocation totals: exact quotas sum to the intended cohort size, or probabilistic allocation probabilities sum to one.
  • Time meaning: every nominal time has a unit and a clear anchor, such as hours after dose or minutes after infusion start.
  • Schedule integrity: times are ordered and duplicates are intentional and distinguished by occasion when necessary.
  • Participant mapping: every participant receives exactly the schedule or schedules allowed by the rule.
  • Count reconciliation: the sum of schedule-specific counts agrees with the total planned sample records.
  • Design separation: scheduled samples remain distinguishable from observations that are later absent or unusable.

A common diagnostic is to summarize the encoded data by participant and schedule. Participants with zero scheduled samples, unexpected sample counts, or times outside their assigned schedule indicate an encoding error unless the protocol explicitly permits that structure. Also inspect counts by time and stratum: a correct overall total can conceal an allocation mistake, such as assigning too many participants to one sparse pattern and too few to another.

Common Mistakes and Alternatives

Common mistake: “There are six sampling times in the study, so every participant has six planned samples.” This confuses the union of times across a sparse design with the schedule assigned to each participant. In the four-pattern example, six times appear across the study, but each participant has only three. The correction is to encode participant-to-schedule assignment and count the times within each assigned schedule.

Another frequent error is mixing time anchors or units—for example, storing one schedule in hours after dose and another in minutes after study start, then treating both as the same time variable. Convert to a common unit only after the event anchors are unambiguous. A further error is to represent a fixed quota using random assignment probabilities and assume the exact quota will result. Use the allocation mechanism that matches the intended design.

A single complete-profile schedule is simple and transparent when all participants have the same planned times. Multiple schedule patterns are more compact for sparse designs and make assignment explicit. A participant-by-time indicator matrix, with entries marking whether a sample is scheduled, is useful for visual checks and for designs with many overlapping schedules. The choice of representation does not change the design, but the encoding must preserve the same participant-level assignments and counts.

These representations have limits. A static schedule table is not sufficient when sampling times are deliberately adapted in response to information observed during the study; such a design needs a specified decision rule and its inputs. Nor does an encoded schedule by itself establish that samples are feasible, that timing is clinically appropriate, or that the resulting design estimates a particular quantity well. Those are separate design and evaluation questions. For this step, the requirement is narrower: simulated planned records must faithfully represent the candidate schedule and allocation.

Key takeaway: A candidate sampling design is more than a list of time points. Encode the time anchor, each participant’s assigned schedule, the sample-size allocation, and the rule that creates that allocation; then reconcile the implied planned-record counts before simulation.

Check Your Understanding

Answer each question, then compare with the solutions.

  1. A hypothetical design assigns 25 participants to a five-time schedule and 15 to a two-time schedule. How many planned samples are there?
  2. Four schedule patterns each contain three times and receive 10 participants. The patterns collectively contain five distinct nominal times. Does each participant have five scheduled samples? Explain.
  3. A rule assigns each participant to one of three schedules with probabilities 0.2, 0.3, and 0.5. What is the probability check, and must the realized schedule counts equal those proportions exactly?
  4. Name two pieces of information needed to interpret a nominal sample time unambiguously.
  5. Why should a scheduled sample be retained as a design record when the corresponding simulated observation is missing?

Solutions. (1) \(25(5)+15(2)=125+30=155\) planned samples. (2) No. Each participant has the three times in their assigned pattern; five is the number of distinct times across patterns. (3) The probabilities are nonnegative and sum to \(0.2+0.3+0.5=1\). Realized counts need not equal those proportions exactly. (4) The time unit and the anchor event, such as hours after dose. (5) The schedule defines intended collection, while missingness describes whether the observation is realized; keeping them separate preserves the design and makes planned and observed records distinguishable.

Clinical Biostats