Use mdes.ird()
to calculate minimum detectable effect size and power.ird()
to calculate statistical power. If higher level strata or fixed blocks exist, use mdes.bird2f1()
to calculate minimum detectable effect size, power.bird2f1()
to calculate statistical power, and cosa.bird2f1()
for bound constrained optimal sample size allocation (BCOSSA).
mdes.ird(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 = n1 - g1 - order * (1 + interaction) - 2,
r21 = 0, g1 = 0, rate.tp = 1, rate.cc = 0, n1)power.ird(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 = n1 - g1 - order * (1 + interaction) - 2,
r21 = 0, g1 = 0, rate.tp = 1, rate.cc = 0, n1)
mdes.bird2f1(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 = n2 * (n1 - 2) - g1 - order * (1 + interaction),
r21 = 0, g1 = 0, rate.tp = 1, rate.cc = 0, n1, n2 = 1)
power.bird2f1(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 = n2 * (n1 - 2) - g1 - order * (1 + interaction),
r21 = 0, g1 = 0, rate.tp = 1, rate.cc = 0, n1, n2 = 1)
cosa.bird2f1(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, cost = NULL,
n1 = NULL, n2 = NULL,
n0 = c(400, 5), p0 = .499,
constrain = "power", round = TRUE, max.power = FALSE,
local.solver = c("LBFGS", "SLSQP"),
power = .80, es = .25, alpha = .05, two.tailed = TRUE,
g1 = 0, r21 = 0)
vector or list; an empirical score variable or an object with class 'score' returned from the inspect.score()
function.
character; distribution of the score variable, "normal"
or "uniform"
. By default, dists = "normal"
specification implies a truncated normal distribution with k1 = -6
and k2 = 6
.
left truncation point for (uncentered) empirical, truncated normal, or uniform distribution. Ignored when rhots = 0
or order = 0
.
right truncation point for (uncentered) empirical, truncated normal, or uniform distribution. Ignored when rhots = 0
or order = 0
.
integer >= 0; order of polynomial functional form specification for the score variable.
logical; if TRUE
polynomial specification interacts with the treatment variable.
obsolote; use order = 0
to obtain results equivalent to random assignment designs.
logical; if TRUE
units below cutoff the are treated.
decision threshold.
proportion of units in the treatment condition.
statistical power (1 - \(\beta\)).
numeric > 0; effect size (Cohen's d).
probability of type I error (\(\alpha\)).
logical; TRUE
for two-tailed hypothesis testing.
degrees of freedom.
number of covariates.
proportion of variance in the outcome explained by covariates.
treatment group participation rate.
control group crossover rate.
sample size (per stratum or block, if exists).
number of stratum or fixed blocks.
marginal cost per unit in treatment and control conditions, e.g. c(10, 5)
.
marginal cost per stratum or fixed block.
total cost or budget. Ignored when constrain = "power"
or constrain = "es"
.
character; constrains one of the "cost"
, "power"
, or "es"
at the specified value.
starting value for n1
or n1, n2
. Starting value is replaced with the average when sample size is constrained by bounds.
starting value for p
when rhots = 0
and p = NULL
. Starting value is replaced with average when p
is constrained by bounds.
logical; TRUE
for rounded BCOSSA solution.
logical; TRUE
for maximizing power instead of minimizing variance, applies when constrain = "cost"
subset of c("LBFGS", "SLSQP")
list of parameters used in the function.
degrees of freedom.
standardized standard error.
BCOSSA solution.
minimum detectable effect size and (1 - \(\alpha\))% confidence limits.
statistical power (1 - \(\beta\))
# NOT RUN {
score.obj <- inspect.score(rnorm(1000),
order = 1, interaction = FALSE,
cutoff = 0, k1 = -1, k2 = 1)
# single site (no blocks)
power.ird(score.obj, g1 = 0, r21 = 0,
es = 0.25, n = 100)
# with 5 blocks (note that r21 is modified but g1 remains the same)
power.bird2f1(score.obj, g1 = 0, r21 = .30,
es = 0.25, n1 = 100, n2 = 5)
# minimum required sample size for each block
cosa.bird2f1(score.obj, g1 = 0, r21 = .30,
n1 = NULL, n2 = 5)
# }
Run the code above in your browser using DataLab