Generate correlated bivariate binary outcomes of toxicity and efficacy for a cohort number of patients.
rBin2Corr(cohortsize, pT, pE, psi, seed=NULL)Return a \(cohortsize \times 2\) matrix with columns corresponding to toxicity and efficacy, and rows for each observations of binary outcome with 0 for no toxicity (no efficacy) and 1 for toxicity (efficacy) at the first (second) column.
Number of patients in each cohort.
Toxicity probability.
Efficacy probability.
Association parameter for efficacy and toxicity, where psi=0 means toxicity and efficacy is independent.
An integer for the seed to generate random numbers, default is NULL.
The formula for generating correlated binary variables is
$$\pi_{i,j} = (\pi_E)^i(1-\pi_E)^{1-i}(\pi_T)^j(1-\pi_T)^{1-j} + (-1)^{i+j}\pi_E(1-\pi_E)\pi_T(1-\pi_T)\left(\frac{e^{\psi}-1}{e^{\psi}+1}\right),$$
where \(i, j = 0, 1\), so that four probabilities can be calculated for the possible combinations of (toxicity, efficacy) including \((1,1), (0,0), (0,1), (1,0)\) given \(\pi_T\) and \(\pi_E\). Multinomial distribution rmultinom is further used to generate bivariate binary outcomes (number equals to cohortsize) based on the four calculated probabilities.
Murtaugh, P. A., & Fisher, L. D. (1990). Bivariate binary models of efficacy and toxicity in dose-ranging trials. Communications in Statistics-Theory and Methods, 19(6), 2003-2020. tools:::Rd_expr_doi("10.1080/03610929008830305")
Thall, P. F., & Cook, J. D. (2004). Dose‐finding based on efficacy–toxicity trade‐offs. Biometrics, 60(3), 684-693. tools:::Rd_expr_doi("10.1111/j.0006-341X.2004.00218.x")
rBin2Corr(cohortsize = 1, pT = 0.2, pE = 0.4, psi = 0, seed=12)
Run the code above in your browser using DataLab