Skip to contents

A DesignSeqOneByOne in which each arriving subject's treatment assignment is drawn independently as \(w_t \stackrel{iid}{\sim} \mathrm{Bernoulli}(prob\_T)\), with no dependence on covariates or on prior assignments — the direct sequential-enrollment analog of DesignFixedBernoulli. As in the fixed-sample version, the realized number of treated subjects after \(t\) arrivals is random (\(\mathrm{Binomial}(t, prob\_T)\)), in contrast to sequential designs that actively balance assignment counts or covariates (e.g. DesignSeqOneByOneAtkinson).

Super classes

Design -> DesignSeqOneByOne -> DesignSeqOneByOneBernoulli

Methods

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


DesignSeqOneByOneBernoulli$is_a_bernoulli_capable()

Characterization: this design draws each subject's treatment assignment as an independent \(\mathrm{Bernoulli}(prob\_T)\) coin flip (see class documentation), so it is Bernoulli-capable by construction.

Usage

DesignSeqOneByOneBernoulli$is_a_bernoulli_capable()

Returns

Always TRUE for this class.


DesignSeqOneByOneBernoulli$new()

Initialize a Bernoulli (independent-coin-flip) sequential experimental design.

Usage

DesignSeqOneByOneBernoulli$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 which must be one of the following: "continuous", "incidence", "proportion", "count", "survival", "ordinal".

prob_T

The probability of the treatment assignment. This defaults to 0.5.

include_is_missing_as_a_new_feature

If missing data is present in a variable, should we include another dummy variable for its missingness? The default is TRUE.

n

The sample size (if fixed). Default is NULL.

verbose

A flag indicating whether messages should be displayed.

missingness_method

How to handle missing values in covariates.

design_formula

A formula object.

seed

Integer seed for reproducibility.

Returns

A new `DesignSeqOneByOneBernoulli` object


DesignSeqOneByOneBernoulli$assign_wt()

Draw the next subject's treatment assignment as a single independent \(\mathrm{Bernoulli}(prob\_T)\) coin flip (see class documentation); does not consult covariates or prior assignments.

Usage

DesignSeqOneByOneBernoulli$assign_wt()

Returns

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


DesignSeqOneByOneBernoulli$clone()

The objects of this class are cloneable with this method.

Usage

DesignSeqOneByOneBernoulli$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

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