
A Sequential Bernoulli (Independent-Coin-Flip) Randomized Design
Source:R/design_seq_one_by_one_bernoulli.R
DesignSeqOneByOneBernoulli.RdA 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
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_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()
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.
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_typeThe data type of response values which must be one of the following: "continuous", "incidence", "proportion", "count", "survival", "ordinal".
prob_TThe probability of the treatment assignment. This defaults to
0.5.include_is_missing_as_a_new_featureIf missing data is present in a variable, should we include another dummy variable for its missingness? The default is
TRUE.nThe sample size (if fixed). Default is
NULL.verboseA flag indicating whether messages should be displayed.
missingness_methodHow to handle missing values in covariates.
design_formulaA formula object.
seedInteger seed for reproducibility.
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.
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