View source: R/CARA_function.R
CARAEE_Sim | R Documentation |
This function simulates a clinical trial using CARA Designs Based on Efficiency and Ethics (CARAEE) with Binary or Continuous Responses.
CARAEE_Sim(n, thetaA, thetaB, m0 = 40, pts.cov, response, gamma)
n |
a positive integer. The value specifies the total number of participants involved in each round of the simulation. |
thetaA |
a vector of length |
thetaB |
a vector of length |
m0 |
a positive integer. The number of first 2m0 patients will be allocated equally for estimation. The default value is 40. |
pts.cov |
a |
response |
the type of the response. Options are |
gamma |
a non-negative number. A tuning parameter that reflects the importance of the efficiency component compared to the ethics component. |
A list with the following elements:
method |
The name of the procedure. |
sampleSize |
Total number of patients. |
parameter |
Estimated parameter values. |
assignment |
Treatment assignment vector. |
proportion |
Proportion of patients allocated to treatment A. |
responses |
Simulated response values. |
failureRate |
Proportion of treatment failures (if |
meanResponse |
Mean response value (if |
rejectNull |
Logical. Indicates whether the treatment effect is statistically significant based on a Wald test. |
set.seed(123)
results = CARAEE_Sim(n = 400,
pts.cov = cbind(rnorm(400), rnorm(400)),
thetaA = c(-1, 1, 1),
thetaB = c(3, 1, 1),
response = "Binary",
gamma=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.