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 (in \((0.5, 1]\), 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). For weighted_coin_prob < 1 every step stays randomized (the coin is strictly between 1 - weighted_coin_prob and weighted_coin_prob). The limit weighted_coin_prob = 1 is allowed: it is deterministic whenever the counts are unequal (the under-represented arm always gets the next subject), so the running counts never differ by more than one and only the fair coin at a tie is random. 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). There is no prob_T argument: allocation is always 1:1 (prob_T = 0.5) because the biased coin always pushes the treated count toward the control count, a 1:1 target.

Usage

DesignSeqOneByOneEfron$new(
  response_type,
  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".

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 of assigning the next subject to whichever of treatment/control currently has fewer subjects, when the running counts are unequal: a single number with \(0.5 < p \le 1\) (Efron's \(p > 1/2\)); other values error. \(p = 1\) is the deterministic limit (see class documentation). 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