HuHu | R Documentation |
Implements the Covariate-Adaptive randomization by Hu and Hu (2012) for assigning patients to two treatments A and B. The procedure works with qualitative covariates only.
HuHu(data, p = 0.85, omega = NULL, print.results = TRUE)
data |
a data frame or a matrix. Each row of |
p |
biased coin probability for the Efron's allocation function ( |
omega |
vector of weights for the overall, within-stratum, and within-covariate-margin levels. If |
print.results |
logical. If TRUE a summary of the results is printed. |
The function assigns patients to treatments A or B as described in Hu and Hu (2012).
The assignment probability to A of each patient is based on the Efron's allocation function (Efron, 1971) with biasing probability equal to p
.
At the end of the study the imbalance measures reported are the loss of estimation precision as described in Atkinson (1982), the Mahalanobis distance and the overall imbalance, defined as the difference in the total number of patients assigned to treatment A and B. The strata imbalances measures report, for each stratum, the total number of patients assigned (N.strata
), the number of patients assigned to A (A.strata
) and the within stratum imbalance (D.strata
), calculated as 2*A.strata
-N.strata
. The within covariate imbalances report, for each level of each qualitative covariate, the difference in the number of patients assigned to A and B. See also Value.
It returns an object of class
"covadap"
, which is a list containing the following elements:
summary.info |
|
Assignments |
a vector with the treatment assignments. |
Imbalances.summary |
summary of overall imbalance measures at the end of the
study ( |
Strata.measures |
a data frame containing for each possiblue stratum the
corresponding imbalances:
|
Imbalances |
a list containing all the imbalance measures:
|
data |
the data provided in input. |
observed.strata |
a data frame with all the observed strata. |
Hu Y, Hu F. Asymptotic properties of covariate-adaptive randomization. The Annals of Statistics, 2012, 40(3): 1794-1815.
Efron B, Forcing a sequential experiment to be balanced. Biometrika, 1971, 58(3): 403-418.
Atkinson A. C. Optimum biased coin designs for sequential clinical trials with prognostic factors. Biometrika, 1982, 69(1): 61-67.
HuHu.sim
for allocating patients by simulating their covariate profiles.
require(covadap)
# Create a sample dataset
df1 <- data.frame("gender" = sample(c("female", "male"), 200, TRUE, c(1 / 3, 2 / 3)),
"age" = sample(c("18-35", "36-50", ">50"), 200, TRUE),
"bloodpressure" = sample(c("normal", "high", "hyper"), 200, TRUE),
stringsAsFactors = TRUE)
# To view a summary of the metrics of the design
HuHu(df1, p = 0.85, omega = NULL, print.results = TRUE)
# To view a summary
# and create a list containing all the metrics of the design
res <- HuHu(df1, p = 0.85, omega = NULL, print.results = TRUE)
res
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.