Learn R Programming

adaptr (version 1.4.0)

get_ys_binom: Generate binary outcomes from binomial distributions

Description

Used internally. Function factory used to generate a function that generates binary outcomes from binomial distributions.

Usage

get_ys_binom(arms, event_probs)

Value

A function which takes the argument allocs (a character vector with the allocations) and returns a numeric vector of similar length with the corresponding, randomly generated outcomes (0 or 1, from binomial distribution).

Arguments

arms

character vector of arms as specified in setup_trial_binom().

event_probs

numeric vector of true event probabilities in all arms as specified in setup_trial_binom().