
Atkinson's (1982) Covariate-Adjusted Biased Coin Sequential Design
Source:R/design_seq_one_by_one_atkinson.R
DesignSeqOneByOneAtkinson.RdA 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
Design$add_all_subject_responses()Design$add_one_subject_response()Design$any_censoring()Design$applicable_inference_class_names()Design$assert_all_responses_recorded()Design$assert_all_subjects_arrived()Design$assert_even_allocation()Design$assert_fixed_sample()Design$capabilities()Design$check_experiment_completed()Design$draw_ws_according_to_design()Design$duplicate()Design$get_X()Design$get_X_imp()Design$get_X_raw()Design$get_design_formula()Design$get_edi_version_created()Design$get_effective_dead()Design$get_effective_time()Design$get_missingness_method()Design$get_n()Design$get_ordinal_levels()Design$get_original_ordinal_levels()Design$get_prob_T()Design$get_response_type()Design$get_response_type_original()Design$get_t()Design$get_w()Design$get_y()Design$get_y_L()Design$get_y_R()Design$get_y_original()Design$has_general_censoring()Design$incompatible_inference_classes_due_to_design_structure()Design$is_a_bernoulli_capable()Design$is_a_cluster_capable()Design$is_a_kk_matching_capable()Design$is_blocking_design()Design$is_fixed_sample_size()Design$is_matching_design()Design$overwrite_all_subject_assignments()Design$prepare_for_resampling_replay()Design$randomization_family()Design$supports()Design$supports_randomization_draw()Design$supports_resampling()Design$supports_resampling_replay()Design$transform_y()Design$unavailable_inference_classes_due_to_missing_packages()Design$warm_all_subject_data_cache()
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_typeThe data type of response values.
prob_TThe 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_featureFlag for missingness indicators.
nThe sample size.
verboseA flag for verbosity.
missingness_methodHow to handle missing values in covariates.
design_formulaA formula object.
seedInteger seed for reproducibility.
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.
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