Skip to contents

A DesignSeqOneByOne that assigns each newly arriving subject's treatment via Atkinson's (1982) \(D_A\)-optimum biased coin: a coin whose treatment probability is skewed away from prob_T toward whichever assignment would most improve the current design's efficiency for estimating the treatment effect \(D_A\)-optimally, given the covariates observed so far. Compared to a fixed-probability coin (e.g. DesignSeqOneByOneBernoulli), this improves covariate balance/estimation efficiency online without ever fully determinizing the assignment (the coin is always strictly between 0 and 1, so randomization-based inference remains valid), at the cost of requiring a numerically well-conditioned design matrix to compute the bias.

Assignment rule. For subject \(t\), let \(Z_{t-1} = [w_{1:t-1}, 1, X_{1:t-1}]\) be the (treatment, intercept, covariates) design matrix accumulated from the first \(t-1\) subjects, and let \(M = (t-1)(Z_{t-1}^\top Z_{t-1})^{-1}\). Writing \(x_t\) for the new subject's covariate vector (with a leading 1 for the intercept) and \(A = M_{[1, 2:]} \cdot x_t\) (the treatment row of \(M\), projected onto \(x_t\)), the treatment probability is $$\pi_t = \frac{\big(M_{11}/A + 1\big)^2}{\big(M_{11}/A + 1\big)^2 + 1},$$ clamped to \([0, 1]\), and subject \(t\) is assigned to treatment with probability \(\pi_t\). This is Atkinson's biased-coin formula for \(D_A\)-optimal sequential design: the coin biases toward the assignment that would most reduce the variance of the treatment-effect estimate under the linear model implied by \(Z_t\), converging toward more extreme (but never fully deterministic) probabilities as the current covariate imbalance grows in directions that matter for that estimate.

Fallback to a fair(-ish) coin. For the first ncol(private$Xraw) + 3 subjects (too few observations for \(Z_{t-1}^\top Z_{t-1}\) to be reliably invertible), and whenever the C++ computation encounters a non-invertible design matrix, a non-finite bias term, or any other numerical failure (caught via tryCatch()), assignment falls back to an unbiased \(\mathrm{Bernoulli}(prob\_T)\) draw instead of Atkinson's rule.

Reproducibility. The per-subject C++ draw (atkinson_assign_weight_cpp()) seeds its own generator from R's RNG stream per call, so seed governs reproducibility of the resulting assignment sequence in the usual way.

References

Atkinson, A. C. (1982). "Optimum biased coin designs for sequential clinical trials with prognostic factors." Biometrika, 69(1), 61-67, doi:10.1093/biomet/69.1.61 . See also randomized experiment for orientation on biased-coin sequential designs.

Super classes

Design -> DesignSeqOneByOne -> DesignSeqOneByOneAtkinson

Methods

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


DesignSeqOneByOneAtkinson$new()

Initialize an Atkinson (1982) biased-coin sequential experimental design (see class documentation for the assignment rule).

Usage

DesignSeqOneByOneAtkinson$new(
  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

response_type

The data type of response values.

prob_T

The nominal probability of treatment assignment; used as the fallback coin probability early in the trial and whenever Atkinson's rule cannot be computed (see class documentation), and as the reference probability the biased coin is skewed away from otherwise.

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 `DesignSeqOneByOneAtkinson` object


DesignSeqOneByOneAtkinson$assign_wt()

Draw the next subject's treatment assignment via Atkinson's (1982) \(D_A\)-optimum biased coin (see class documentation for the exact probability formula), falling back to an unbiased \(\mathrm{Bernoulli}(prob\_T)\) draw early in the trial or on numerical failure of the biased-coin computation.

Usage

DesignSeqOneByOneAtkinson$assign_wt()

Returns

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


DesignSeqOneByOneAtkinson$clone()

The objects of this class are cloneable with this method.

Usage

DesignSeqOneByOneAtkinson$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

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