Use mdes.ird1r1()
to calculate minimum detectable effect size, power.ird1r1()
to calculate statistical power, and cosa.ird1r1()
for constrained optimal sample allocation.
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 constrained optimal sample allocation.
cosa.ird1r1(cn1 = 0, cost = NULL, n1 = NULL, p = NULL,
n0 = c(400 + g1), p0 = .499, constrain = "power",
round = TRUE, max.power = FALSE,
local.solver = c("LBFGS", "SLSQP", "MMA", "COBYLA"),
rhots = NULL, k1 = -6, k2 = 6, dists = "normal",
power = .80, es = .25, alpha = .05, two.tailed = TRUE,
g1 = 0, r21 = 0)cosa.bird2f1(cn1 = 0, cn2 = 0, cost = NULL, n1 = NULL, n2 = NULL, p = NULL,
n0 = c(400 + g1, 5), p0 = .499, constrain = "power",
round = TRUE, max.power = FALSE,
local.solver = c("LBFGS", "SLSQP", "MMA", "COBYLA"),
rhots = NULL, k1 = -6, k2 = 6, dists = "normal",
power = .80, es = .25, alpha = .05, two.tailed = TRUE,
g1 = 0, r21 = 0)
mdes.ird1r1(power = .80, alpha = .05, two.tailed = TRUE,
rhots = NULL, k1 = -6, k2 = 6, dists = "normal",
r21 = 0, g1 = 0, p = .50, n1)
mdes.bird2f1(power = .80, alpha = .05, two.tailed = TRUE,
rhots = NULL, k1 = -6, k2 = 6, dists = "normal",
r21 = 0, g1 = 0, p = .50, n1, n2)
power.ird1r1(es = .25, alpha = .05, two.tailed = TRUE,
rhots = NULL, k1 = -6, k2 = 6, dists = "normal",
r21 = 0, g1 = 0, p = .50, n1)
power.bird2f1(es = .25, alpha = .05, two.tailed = TRUE,
rhots = NULL, k1 = -6, k2 = 6, dists = "normal",
r21 = 0, g1 = 0, p = .50, n1, n2)
marginal cost per unit in treatment and control conditions.
marginal cost per stratum or fixed block.
total cost or budget.
sample size (per stratum or block, if exists).
number of stratum or fixed blocks.
proportion of units in treatment condition.
starting value for n1
or n1, n2
. Starting value is replaced with 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.
statistical power (1 - \(\beta\)).
effect size (Cohen's d).
probability of type I error (\(\alpha\)).
logical; TRUE
for two-tailed hypothesis testing.
character; "cost"
, "power"
, or "mdes"
.
logical; TRUE
for rounded COSA solution.
logical; TRUE
for maximizing power instead of minimizing variance.
subset of c("LBFGS", "SLSQP", "MMA", "COBYLA")
correlation between the treatment and the scoring variable. Specify rhots = 0
to obtain results equivalent to random assignment designs.
left truncation point (in standard deviation units from full normal distribution mean), ignored when rhots
is not NULL
or dists = "uniform"
.
right truncation point (in standard deviation units from full normal distribution mean), ignored when rhots
is not NULL
or dists = "uniform"
.
character; distribution of the scoring variable, "normal"
or "uniform"
. By default, dists = "normal"
specification implies a truncated normal distribution with k1 = -6
and k2 = 6
.
number of covariates.
proportion of variance in the outcome explained by covariates.
list of parameters used in the function.
degrees of freedom.
standardized standard error.
constrained optimal sample allocation.
minimum detectable effect size and (1 - \(\alpha\))% confidence limits.
statistical power (1 - \(\beta\))
# NOT RUN {
# cost constrained - optimize p and n1
cosa.ird1r1(rhots = 0, constrain = "cost", cost = 1000,
cn1 = c(10,5), p = NULL, n1 = NULL)
# minimum detectable effect size
mdes.ird1r1(power = .80, r2 = .20, g = 1, p = .50, n = 500)
# statistical power
power.ird1r1(es = .373, r2 = .20, g = 1, p = .50, n = 500)
# }
Run the code above in your browser using DataLab