The optimal design of single-level RCTs
probing mediation effects is to identify the optimal sample
allocation that use the minimum budget to achieve a fixed level of
statistical power. The optimal design parameter is the proportion of
individuals/units to be assigned to the experimental condition.
This function identifies the optimal p
.
od.1.111(
a = NULL,
b = NULL,
c1 = NULL,
c1t = NULL,
m = NULL,
r.yx = 0,
r.mx = 0,
r.mw = 0,
q.a = 0,
q.b = 0,
test = "joint",
p = NULL,
n = NULL,
tol = 1e-11,
power = 0.8,
d.p = c(0.1, 0.5),
sig.level = 0.05,
two.tailed = TRUE,
plim = c(0.01, 0.99),
varlim = c(0, 0.001),
plab = NULL,
varlab = NULL,
vartitle = NULL,
nlim = c(6, 1e+06),
verbose = TRUE,
max.value = Inf,
max.iter = 300,
e = 1e-10,
n.of.ants = 10,
n.of.archive = 20,
q = 1e-04,
xi = 0.5
)
Unconstrained or constrained optimal sample allocation p
).
The function also returns statistical power,
function name, design type,
and parameters used in the calculation.
The treatment effect on the mediator.
The within-treatment correlation between the outcome and the mediator.
The cost of sampling an individual in the control group.
The cost of sampling an individual in the treated group.
Total budget.
The within-treatment correlation between the outcome and the covariate(s) in the outcome model.
The within-treatment correlation between the mediator and the covariate(s) in the outcome model.
The within-treatment correlation between the mediator and the covariate(s) in the mediator model.
The number of covariates at the mediator model (except the treatment indicator), the default value is zero.
The number of covariates in the outcome model (except the treatment indicator and the mediator), the default value is zero.
The type of test will be used to detect mediation effects. The default is the joint significance test (i.e., test = "joint", "Joint","JOINT"). Another choice is the Sobel test by specifying the argument as test = "sobel", "Sobel", or "SOBEL".
The proportion of level-4 clusters/units to be assigned to treatment.
Total number of individuals in the experimental study, the default value is NULL.
convergence tolerance.
Statistical power specified, default is .80.
The initial sampling domains for p. Default is c(0.10, 0.50).
Significance level or type I error rate, default value is 0.05.
Two tailed test, the default value is TRUE.
The plot range for p, default value is c(0, 1).
The plot range for variance, default value is c(0, 0.05).
The plot label for p
,
default value is "Proportion of Individuals in Treatment: p".
The plot label for variance, default value is "Variance".
The title of variance plot, default value is NULL.
The interval/range used to numerically solve for n, the default values are c(6, 1e7).
Print out evaluation process if TRUE, default is TRUE.
Maximal value of optimization when used as the stopping criterion. Default is infinite.
Maximal number of function evaluations when used as the stopping criterion. Default is 200.
Maximum error value used when solution quality used as the stopping criterion, default is 1e-10.
Number of ants used in each iteration after the initialization stage, the default value is 10.
Size of the solution archive, default is 20.
Locality of the search (0,1), default is 0.0001.
Convergence pressure (0, Inf), suggested: (0, 1), default is 0.5.
myod <- od.1.111(a = .3, b = .5, c1 = 10, c1t = 100)
myod
Run the code above in your browser using DataLab