Learn R Programming

confidenceSim (version 0.1.0)

getDataOrd: Generate ordinal data

Description

Given an arm allocation and response rates, this function generates response on an ordinal scale.

Usage

getDataOrd(arm, resprate)

Value

Returns an ordinal value corresponding to patient response.

Arguments

arm

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

resprate

Response rates for each arm. Expects a list of n lists with the first list containing probabilities for response level which correspond to the control arm.

Examples

Run this code
# for a three-point ordinal scale
response <- getDataOrd(1, list(control = c(0.3, 0.5, 0.7), treatment = (c(0.5, 0.3, 0.2))))

Run the code above in your browser using DataLab