Skip to contents

A 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


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_T

Nominal 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_feature

Flag for missingness indicators.

n

The sample size.

verbose

A flag for verbosity.

weighted_coin_prob

The 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_method

How to handle missing values in covariates.

design_formula

A formula object.

seed

Integer seed for reproducibility.

Returns

A new `DesignSeqOneByOneEfron` object


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.

Usage

DesignSeqOneByOneEfron$assign_wt()

Returns

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


DesignSeqOneByOneEfron$clone()

The objects of this class are cloneable with this method.

Usage

DesignSeqOneByOneEfron$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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