powered by
Given an arm allocation and response rates, this function generates a binary response.
getDataBin(arm, resprate)
Returns a binary value corresponding to patient response.
Arm allocation for a single patient.Expects number in 1,2,...,n where n the number of treatment arms including control.
Response rates for each arm. Expects a vector of probabilities of length n with the first corresponding to response rate of the control arm.
response <- getDataBin(1, c(0.5, 0.7))
Run the code above in your browser using DataLab