Skip to contents

A DesignSeqOneByOne implementing Pocock and Simon's minimization method: for each categorical covariate in strata_cols, the design tracks a running treated/control count per covariate level (private$counts), and for a new subject computes, for each candidate treatment arm \(k \in \{0, 1\}\), a weighted total imbalance $$G_k = \sum_{j} weights_j \cdot \mathrm{Var}\big(\text{counts at subject's level of covariate } j, \text{ after hypothetically assigning arm } k\big),$$ where the variance is taken across the two treatment arms' hypothetical counts at that covariate level (so \(G_k\) is large when arm \(k\) would leave the subject's covariate-level counts unbalanced, summed with weights across covariates). The subject is then assigned to whichever arm minimizes \(G_k\) with probability p_best (and to the other arm with probability 1 - p_best), or — if the two arms are exactly tied — via a plain \(\mathrm{Bernoulli}(prob\_T)\) draw. Unlike DesignSeqOneByOneAtkinson/ DesignSeqOneByOneKK14, which use continuous covariate distances, minimization operates on categorical/discretized strata and balances marginal covariate-level counts directly rather than a multivariate distance or matched-pair structure.

Level bookkeeping. private$ensure_factor_metadata() maintains a mapping from each observed level of each strata_cols column to a row index in private$counts (an (total levels across all covariates) x 2 matrix of running treated/control counts), growing both the level map and counts as new levels are encountered; missing values are treated as their own level ("NA").

Non-resampling bootstrap. draw_bootstrap_indices() always performs a plain i.i.d. nonparametric bootstrap over subjects (sample_int_replace_cpp()), since minimization's adaptive assignment process has no simple exchangeable resampling unit to preserve (each subject's assignment probability depends on the full sequence of covariate levels and assignments that preceded it).

References

Pocock, S. J., and Simon, R. (1975). "Sequential treatment assignment with balancing for prognostic factors in the controlled clinical trial." Biometrics, 31(1), 103-115, doi:10.2307/2529712 . See also minimisation (clinical trials) for orientation.

Super classes

Design -> DesignSeqOneByOne -> DesignSeqOneByOnePocockSimon

Methods

+ inherited public methods from DesignSeqOneByOne
+ inherited public methods from Design


DesignSeqOneByOnePocockSimon$new()

Initialize a Pocock and Simon (1975) minimization sequential experimental design (see class documentation for the exact imbalance criterion and assignment rule).

Usage

DesignSeqOneByOnePocockSimon$new(
  strata_cols,
  weights = NULL,
  p_best = 0.8,
  response_type,
  prob_T = 0.5,
  include_is_missing_as_a_new_feature = TRUE,
  n = NULL,
  verbose = FALSE,
  missingness_method = "impute",
  design_formula = ~.,
  seed = NULL
)

Arguments

strata_cols

The names of the covariates to be used for minimization. These must be factor or categorical variables.

weights

A numeric vector of per-covariate weights \(weights_j\) in the imbalance criterion \(G_k\) (see class documentation), one per entry of strata_cols, in the same order. Defaults to 1 for all (equal-weighted covariates).

p_best

The probability of assigning the treatment arm that minimizes \(G_k\) (see class documentation); the complementary arm is assigned with probability 1 - p_best. Defaults to 0.8 (an 80/20 biased coin favoring the balancing arm, rather than a fully deterministic minimization rule).

response_type

The data type of response values.

prob_T

The probability of the treatment assignment used only when the two arms' imbalance is exactly tied (see class documentation).

include_is_missing_as_a_new_feature

Flag for missingness indicators.

n

The sample size.

verbose

Flag for verbosity.

missingness_method

How to handle missing values in covariates.

design_formula

A formula object.

seed

Integer seed for reproducibility.

Returns

A new `DesignSeqOneByOnePocockSimon` object


DesignSeqOneByOnePocockSimon$assign_wt()

Draw the next subject's treatment assignment via Pocock and Simon minimization (see class documentation for the exact imbalance criterion \(G_k\) and the p_best/prob_T assignment rule), and update the running per-covariate-level treated/control counts in-place to reflect this assignment.

Usage

DesignSeqOneByOnePocockSimon$assign_wt()

Returns

The treatment assignment (0 or 1) for the next subject.


DesignSeqOneByOnePocockSimon$clone()

The objects of this class are cloneable with this method.

Usage

DesignSeqOneByOnePocockSimon$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

seq_des = DesignSeqOneByOnePocockSimon$new(strata_cols = 'x1', n = 6, response_type = 'continuous')
seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = factor(1, levels=1:2)))
#> [1] 0