crd3 {cosa} | R Documentation |
Cluster-level Regression Discontinuity (Three-level Design, Discontinuity at Level 3, w/ or w/o Strata or Fixed Blocks)
Description
Use mdes.crd3()
to calculate minimum detectable effect size, power.crd3()
to calculate statistical power, and cosa.crd3()
for bound constrained optimal sample size allocation (BCOSSA). If higher level strata or fixed blocks exist, use mdes.bcrd4f3()
to calculate minimum detectable effect size, power.bcrd4f3()
to calculate statistical power, and cosa.bcrd4f3()
for BCOSSA.
Usage
mdes.crd3(score = NULL, dists = "normal", k1 = -6, k2 = 6,
order = 1, interaction = FALSE,
treat.lower = TRUE, cutoff = 0, p = NULL,
power = .80, alpha = .05, two.tailed = TRUE,
df = n3 - g3 - order * (1 + interaction) - 2,
rho2, rho3, r21 = 0, r22 = 0, r23 = 0,
g3 = 0, rate.tp = 1, rate.cc = 0, n1, n2, n3)
power.crd3(score = NULL, dists = "normal", k1 = -6, k2 = 6,
order = 1, interaction = FALSE,
treat.lower = TRUE, cutoff = 0, p = NULL,
es = .25, alpha = .05, two.tailed = TRUE,
df = n3 - g3 - order * (1 + interaction) - 2,
rho2, rho3, r21 = 0, r22 = 0, r23 = 0,
g3 = 0, rate.tp = 1, rate.cc = 0, n1, n2, n3)
cosa.crd3(score = NULL, dists = "normal", k1 = -6, k2 = 6, rhots = NULL,
order = 1, interaction = FALSE,
treat.lower = TRUE, cutoff = 0, p = NULL,
cn1 = 0, cn2 = 0, cn3 = 0, cost = NULL,
n1 = NULL, n2 = NULL, n3 = NULL,
n0 = c(10, 3, 100), p0 = .499,
constrain = "power", round = TRUE, max.power = FALSE,
local.solver = c("LBFGS", "SLSQP"),
power = .80, es = .25, alpha = .05, two.tailed = TRUE,
rho2, rho3, g3 = 0, r21 = 0, r22 = 0, r23 = 0)
mdes.bcrd4f3(score = NULL, dists = "normal", k1 = -6, k2 = 6,
order = 1, interaction = FALSE,
treat.lower = TRUE, cutoff = 0, p = NULL,
power = .80, alpha = .05, two.tailed = TRUE,
df = n4 * (n3 - 2) - g3 - order * (1 + interaction),
rho2, rho3, r21 = 0, r22 = 0, r23 = 0, g3 = 0,
rate.tp = 1, rate.cc = 0, n1, n2, n3, n4)
power.bcrd4f3(score = NULL, dists = "normal", k1 = -6, k2 = 6,
order = 1, interaction = FALSE,
treat.lower = TRUE, cutoff = 0, p = NULL,
es = .25, alpha = .05, two.tailed = TRUE,
df = n4 * (n3 - 2) - g3 - order * (1 + interaction),
rho2, rho3, r21 = 0, r22 = 0, r23 = 0, g3 = 0,
rate.tp = 1, rate.cc = 0, n1, n2, n3, n4)
cosa.bcrd4f3(score = NULL, dists = "normal", k1 = -6, k2 = 6, rhots = NULL,
order = 1, interaction = FALSE,
treat.lower = TRUE, cutoff = 0, p = NULL,
cn1 = 0, cn2 = 0, cn3 = 0, cn4 = 0, cost = NULL,
n1 = NULL, n2 = NULL, n3 = NULL, n4 = NULL,
n0 = c(10, 3, 100 + g3 + order * (1 + interaction), 5), p0 = .499,
constrain = "power", round = TRUE, max.power = FALSE,
local.solver = c("LBFGS", "SLSQP"),
power = .80, es = .25, alpha = .05, two.tailed = TRUE,
rho2, rho3, g3 = 0, r21 = 0, r22 = 0, r23 = 0)
Arguments
score |
vector or list; an empirical score variable or an object with class 'score' returned from the |
dists |
character; distribution of the score variable, |
k1 |
left truncation point for (uncentered) empirical, truncated normal, or uniform distribution. Ignored when |
k2 |
right truncation point for (uncentered) empirical, truncated normal, or uniform distribution. Ignored when |
order |
integer >= 0; order of polynomial functional form specification for the score variable. |
interaction |
logical; if |
rhots |
obsolote; use |
treat.lower |
logical; if |
cutoff |
decision threshold. |
p |
proportion of level 3 units in the treatment condition. |
power |
statistical power (1 - |
es |
effect size (Cohen's d). |
alpha |
probability of type I error ( |
two.tailed |
logical; |
df |
degrees of freedom. |
rho2 |
proportion of variance in the outcome between level 2 units (unconditional ICC2). |
rho3 |
proportion of variance in the outcome between level 3 units (unconditional ICC3). |
g3 |
number of covariates at level 3. |
r21 |
proportion of level 1 variance in the outcome explained by level 1 covariates. |
r22 |
proportion of level 2 variance in the outcome explained by level 2 covariates. |
r23 |
proportion of level 3 variance in the outcome explained by level 3 covariates. |
rate.tp |
treatment group participation rate. |
rate.cc |
control group crossover rate. |
n1 |
average number of level 1 units per level 2 unit. |
n2 |
average number of level 2 units per level 3 unit. |
n3 |
number of level 3 units(per stratum or block, if exists). |
n4 |
number of stratum or fixed blocks. |
cn1 |
marginal costs per level 1 unit in treatment and control conditions (positional), e.g. |
cn2 |
marginal costs per level 2 unit in treatment and control conditions (positional), e.g. |
cn3 |
marginal costs per level 3 unit in treatment and control conditions (positional), e.g. |
cn4 |
marginal cost per stratum or fixed block. |
cost |
total cost or budget. Ignored when |
p0 |
starting value for |
n0 |
vector of starting values for |
constrain |
character; constrains one of the |
round |
logical; |
max.power |
logical; |
local.solver |
subset of |
Value
parms |
list of parameters used in the function. |
df |
degrees of freedom. |
sse |
standardized standard error. |
cosa |
BCOSSA solution. |
mdes |
minimum detectable effect size and (1 - |
power |
statistical power (1 - |
Examples
score.obj <- inspect.score(rnorm(1000),
order = 1, interaction = FALSE,
cutoff = 0, k1 = -1, k2 = 1)
# single site (no blocks)
power.crd3(score.obj,
es = .25, rho2 = .20, rho3 = .10,
g3 = 0, r23 = 0, n1 = 20, n2 = 3, n3 = 40)
# with 5 blocks (note that r23 is modified but g3 remains the same)
power.bcrd4f3(score.obj,
es = .25, rho2 = .20, rho3 = .10,
g3 = 0, r23 = .30,
n1 = 20, n2 = 3, n3 = 40, n4 = 5)
# minimum required number of level 3 units for each block
cosa.bcrd4f3(score.obj,
es = .25, rho2 = .20, rho3 = .10,
g3 = 0, r23 = .30,
n1 = 20, n2 = 2, n3 = NULL, n4 = 5)