
Efron's (1971) Biased Coin Sequential Design
Source:R/design_seq_one_by_one_efron.R
DesignSeqOneByOneEfron.RdA DesignSeqOneByOne implementing Efron's (1971)
biased coin: no covariates are used, only the running counts of treated
(\(n_T\)) and control (\(n_C\)) subjects assigned so far. If the counts are
currently equal, the next subject is assigned by a fair \(\mathrm{Bernoulli}(0.5)\)
coin; otherwise, the next subject is assigned to the currently
under-represented group with probability weighted_coin_prob
(\(> 0.5\), e.g. the classical \(2/3\)) and to the over-represented group with
probability 1 - weighted_coin_prob. This keeps the running treatment/control
counts close to balanced throughout enrollment (unlike
DesignSeqOneByOneBernoulli, whose
running counts can drift arbitrarily far from balanced) while remaining strictly
randomized at every step (the coin is always strictly between
1 - weighted_coin_prob and weighted_coin_prob, never fully
deterministic), unlike a purely deterministic alternating allocation. This is a
count-balancing design only — it does not use covariates at all, in contrast to
DesignSeqOneByOneAtkinson/
DesignSeqOneByOneKK21, which bias the coin
toward covariate balance rather than (or in addition to) count balance.
References
Efron, B. (1971). "Forcing a sequential experiment to be balanced." Biometrika, 58(3), 403-417, doi:10.1093/biomet/58.3.403 . See also randomized experiment for orientation on biased-coin sequential designs.
Super classes
Design -> DesignSeqOneByOne -> DesignSeqOneByOneEfron
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()
DesignSeqOneByOneEfron$new()
Initialize an Efron (1971) biased coin sequential experimental design (see class documentation for the exact assignment rule).
Usage
DesignSeqOneByOneEfron$new(
response_type,
prob_T = 0.5,
include_is_missing_as_a_new_feature = TRUE,
n = NULL,
verbose = FALSE,
weighted_coin_prob = 2/3,
missingness_method = "impute",
design_formula = ~.,
seed = NULL
)Arguments
response_type"continuous", "incidence", "proportion", "count", "survival", or "ordinal".
prob_TNominal probability of treatment assignment; used only as the fair-coin probability when the running treated/control counts are exactly equal (see
assign_wt()).include_is_missing_as_a_new_featureFlag for missingness indicators.
nThe sample size.
verboseA flag for verbosity.
weighted_coin_probThe probability (\(> 0.5\)) of assigning the next subject to whichever of treatment/control currently has fewer subjects, when the running counts are unequal. Default \(2/3\), the value from Efron (1971).
missingness_methodHow to handle missing values in covariates.
design_formulaA formula object.
seedInteger seed for reproducibility.
DesignSeqOneByOneEfron$assign_wt()
Draw the next subject's treatment assignment via Efron's
(1971) biased coin (see class documentation): a fair coin if the running
treated/control counts are equal, otherwise a coin biased toward the
currently under-represented group at probability weighted_coin_prob.
Examples
seq_des = DesignSeqOneByOneEfron$new(n = 6, response_type = 'continuous')
seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = rnorm(1)))
#> [1] 0