Skip to contents

A DesignSeqOneByOne implementing Wei's adaptive biased-coin urn design \(UD(\alpha, \beta)\): conceptually, an urn starts with \(\alpha\) balls of each type (treatment and control), and each assignment is drawn proportionally to the current ball counts, then \(\beta\) balls of the opposite type to whatever was drawn are added back to the urn (so drawing treatment adds \(\beta\) control balls, and vice versa), pushing subsequent draws toward the under-represented arm. No covariates are used; only the running treated/control counts \(n_T\), \(n_C\) matter, via the closed-form assignment probability $$\Pr(w_t = 1) = \frac{\alpha + \beta \, n_C}{2\alpha + \beta (n_T + n_C)}.$$ Like DesignSeqOneByOneEfron, this design balances running assignment counts online while remaining strictly randomized (the probability is always strictly between 0 and 1 for finite \(\alpha, \beta > 0\)); unlike Efron's design (which only distinguishes "balanced" vs. "imbalanced" and applies a single fixed weighted_coin_prob in the imbalanced case), the urn design's bias toward the under-represented arm scales continuously and smoothly with the current degree of imbalance, tuned by the ratio \(\beta/\alpha\): larger \(\beta/\alpha\) yields stronger balancing pressure, and \(\beta = 0\) recovers a fixed \(\mathrm{Bernoulli}(0.5)\) coin (no adaptation at all).

References

Wei, L. J. (1977). "A class of designs for sequential clinical trials." Journal of the American Statistical Association, 72(358), 382-386, doi:10.1080/01621459.1977.10481006 ; Wei, L. J. (1978). "The adaptive biased coin design for sequential experiments." The Annals of Statistics, 6(1), 92-100, doi:10.1214/aos/1176344068 . See also randomized experiment for orientation on adaptive biased-coin sequential designs.

Super classes

Design -> DesignSeqOneByOne -> DesignSeqOneByOneUrn

Methods

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


DesignSeqOneByOneUrn$new()

Initialize Wei's UD(\(\alpha\), \(\beta\)) adaptive urn sequential experimental design (see class documentation for the exact assignment-probability formula).

Usage

DesignSeqOneByOneUrn$new(
  alpha = 1,
  beta = 1,
  response_type,
  include_is_missing_as_a_new_feature = TRUE,
  n = NULL,
  verbose = FALSE,
  missingness_method = "impute",
  design_formula = ~.,
  seed = NULL
)

Arguments

alpha

The initial number of balls of each type (Treatment/Control) in the conceptual urn; larger alpha relative to beta weakens the balancing effect (assignment probabilities stay closer to 0.5 for longer).

beta

The number of balls of the opposite type added to the urn after each assignment; beta = 0 recovers an unbiased \(\mathrm{Bernoulli}(0.5)\) coin (no balancing).

response_type

The data type of response values.

include_is_missing_as_a_new_feature

Flag for missingness indicators.

n

The sample size.

verbose

A 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 `DesignSeqOneByOneUrn` object


DesignSeqOneByOneUrn$assign_wt()

Draw the next subject's treatment assignment from Wei's UD(\(\alpha\), \(\beta\)) urn probability (see class documentation), computed from the running treated/control counts.

Usage

DesignSeqOneByOneUrn$assign_wt()

Returns

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


DesignSeqOneByOneUrn$clone()

The objects of this class are cloneable with this method.

Usage

DesignSeqOneByOneUrn$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

seq_des = DesignSeqOneByOneUrn$new(n = 6, response_type = 'continuous')
seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = rnorm(1)))
#> [1] 1