View source: R/CARA_function.R
CADBCD_Sim | R Documentation |
This function simulates a clinical trial using the Covariate Adjusted Doubly Biased Coin Design (CADBCD) with Binary or Continuous Responses.
CADBCD_Sim(n, thetaA, thetaB, m0 = 40, pts.cov, v = 2, response, target)
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 |
v |
a non-negative integer that controls the randomness of CADBCD design. The default value is 2. |
response |
the type of the response. Options are |
target |
the type of optimal allocation target. Options are |
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 = CADBCD_Sim(n = 400,
pts.cov = cbind(rnorm(400), rnorm(400)),
thetaA = c(-1, 1, 1),
thetaB = c(3, 1, 1),
response = "Binary",
target = "Neyman")
results
## view the settings
results$method
results$sampleSize
## view the simulation results
results$parameter
results$assignments
results$proportion
results$responses
results$failureRate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.