Learn R Programming

confidenceSim (version 0.1.0)

getDataBin: Generate binary data

Description

Given an arm allocation and response rates, this function generates a binary response.

Usage

getDataBin(arm, resprate)

Value

Returns a binary value corresponding to patient response.

Arguments

arm

Arm allocation for a single patient.Expects number in 1,2,...,n where n the number of treatment arms including control.

resprate

Response rates for each arm. Expects a vector of probabilities of length n with the first corresponding to response rate of the control arm.

Examples

Run this code

response <- getDataBin(1, c(0.5, 0.7))

Run the code above in your browser using DataLab