View source: R/CARA_function.R
CARAEE_Alloc | R Documentation |
Calculating the probability of assigning the upcoming patient to treatment A based on the patient's covariates and the previous patients' covariates and responses for CARAEE procedure.
CARAEE_Alloc(ptsb.cov, ptsb.t, ptsb.Y, ptnow.cov, gamma, response)
ptsb.cov |
a |
ptsb.t |
a treatment vector of previous patients with length |
ptsb.Y |
a response vector of previous patients with length |
ptnow.cov |
a covariate vector of the incoming patient with length |
gamma |
a non-negative number. A tuning parameter that reflects the importance of the efficiency component compared to the ethics component. |
response |
the type of the response. Options are |
Covariate-Adjusted Response-Adaptive with Ethics and Efficiency (CARAEE) Design: The CARAEE procedure balances both ethical considerations and statistical efficiency when assigning subjects to treatments.
As a start-up rule, m_0
subjects are assigned to each treatment using a balanced randomization scheme.
Assume that m \geq 2m_0
subjects have been assigned, and their responses \{\boldsymbol{X}_i, i = 1, \ldots, m\}
and covariates \{\boldsymbol{Z}_i, i = 1, \ldots, m\}
are observed. Let \hat{\boldsymbol{\theta}}(m) = \left( \hat{\theta}_1(m), \hat{\theta}_2(m) \right)
, where \hat{\theta}_k(m)
is the maximum likelihood estimate of the treatment-specific parameter \theta_k
based on the data for treatment group k
.
For the incoming subject (m+1)
with covariates \boldsymbol{Z}_{m+1}
, we define the efficiency and ethics measures for each treatment as:
\boldsymbol{d}(\boldsymbol{Z}, \boldsymbol{\theta}) = \left(d_1(\boldsymbol{Z}, \theta), d_2(\boldsymbol{Z}, \theta)\right), \quad
\boldsymbol{e}(\boldsymbol{Z}, \boldsymbol{\theta}) = \left(e_1(\boldsymbol{Z}, \theta), e_2(\boldsymbol{Z}, \theta)\right).
The allocation probability of assigning subject (m+1)
to treatment 1 is given by:
\phi_{m+1}(\boldsymbol{Z}_{m+1}, \hat{\boldsymbol{\theta}}(m)) =
\frac{e_1(\boldsymbol{Z}_{m+1}, \hat{\boldsymbol{\theta}}(m)) \cdot d_1^\gamma(\boldsymbol{Z}_{m+1}, \hat{\boldsymbol{\theta}}(m))}
{e_1(\boldsymbol{Z}_{m+1}, \hat{\boldsymbol{\theta}}(m)) \cdot d_1^\gamma(\boldsymbol{Z}_{m+1}, \hat{\boldsymbol{\theta}}(m)) + e_2(\boldsymbol{Z}_{m+1}, \hat{\boldsymbol{\theta}}(m)) \cdot d_2^\gamma(\boldsymbol{Z}_{m+1}, \hat{\boldsymbol{\theta}}(m))}.
This allocation rule is scale-invariant in both efficiency and ethics components due to its ratio-based form. The tuning parameter \gamma \geq 0
controls the trade-off between the two: when \gamma = 0
, the assignment is based purely on ethical considerations; larger values of \gamma
increase the emphasis on statistical efficiency. More details can be found in Hu, Zhu & Zhang(2015).
prob |
Probability of assigning the upcoming patient to treatment A for binary and continuous response. |
Hu, J., Zhu, H., & Hu, F. (2015). A unified family of covariate-adjusted response-adaptive designs based on efficiency and ethics. Journal of the American Statistical Association, 110(509), 357–367.
set.seed(123)
n_prev = 40
covariates = cbind(Z1 = rnorm(n_prev), Z2 = rnorm(n_prev))
treatment = sample(c(0, 1), n_prev, replace = TRUE)
response = rbinom(n_prev, size = 1, prob = 0.6)
# Simulate new incoming patient
new_patient_cov = c(Z1 = rnorm(1), Z2 = rnorm(1))
# Run allocation function
result = CARAEE_Alloc(
ptsb.cov = covariates,
ptsb.t = treatment,
ptsb.Y = response,
ptnow.cov = new_patient_cov,
response = "Binary",
gamma=1
)
print(result$prob)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.