summary_covadap {covadap} | R Documentation |
Summary of Covariate-Adaptive Designs
Description
This function automatically recognizes the design implemented and provides a summary of the results.
Usage
summary_covadap(res)
Arguments
res |
An object of class |
Details
When applied to an object of class
"covadap"
:
if at least one qualitative covariate is present, the function returns the within-covariate imbalances reporting, for each level of each qualitative covariate, the difference in the number of patients assigned to A and B.
If instead at least one quantitative covariate is present, the function returns the difference in means. For each quantitative covariate, the difference in the mean in group A and B is reported.
When applied to an object of class
"covadapsim"
, it reports the averages, in absolute value, of the imbalance measures, strata imbalances and within-covariate imbalances of the nrep
trial replications according to the nature of the covariates.
Value
The form of the value returned by summary_covadap
depends on the class of the argument provided (see Details).
Examples
#Create a sample dataset
df1 <- data.frame("gender" = sample(c("female", "male"), 100, TRUE, c(1 / 3, 2 / 3)),
"age" = sample(c("18-35", "36-50", ">50"), 100, TRUE),
"bloodpressure" = sample(c("normal", "high", "hyper"), 100, TRUE),
stringsAsFactors = TRUE)
res1 <- ECADE(data = df1, all.cat = TRUE,
alloc.function = "Efron", rho = 0.85)
summary_covadap(res1)
res2 <- ECADE.sim(data = df1, cov = NULL, n = NULL, all.cat = TRUE,
alloc.function = "Efron", rho = 0.85, nrep = 100)
summary_covadap(res2)