Learn R Programming

visit (version 2.2)

vtScenario: Set simulation scenario

Description

Simulation function. Get true \(\theta\)'s using marginal probabilities and odds ratio \(\rho\) for all dose levels.

Usage

vtScenario(tox = c(0.05, 0.05, 0.08), res = c(0.2, 0.3, 0.5),
  rho = 1)

Value

a VTTRUEPS object containing all \(\theta\)'s in a matrix with its number of rows equaling the number of dose levels and its number of columns being 4.

Arguments

tox

Vector of marginal DLT risk rates for all levels

res

Vector of marginal immune response rates for all levels

rho

Vector of odds ratio for all levels. If length of rho is shorter than the length of tox or res, vector rho is repeated to have the same length as tox and res.

Details

The calculation is as following. If \(\rho = 1\), then \(\theta_{11} = pq\), \(\theta_{01} = (1-p)q\), \(\theta_{10} = p(1-q)\), and \(\theta_{00} = (1-p)(1-q)\). Otherwise, \( \theta_{11} = -(\sqrt{A+B}\), \(\theta_{01} = q-\theta_{11}\), \(\theta_{10} = p-\theta_{11}\), and \(\theta_{00} = \theta_{01}\theta_{10}\rho/\theta_{11}\), where \(A=(p+q-p \rho-q\rho-1)^2-4(\rho-1)pq\rho)\) and \(B=(p+q-p\rho-q\rho-1))/2/(\rho-1)\).

Examples

Run this code
 rst.sce <- vtScenario(tox=c(0.05, 0.05, 0.08), res=c(0.2, 0.3, 0.5), rho=1)

Run the code above in your browser using DataLab