Learn R Programming

PowerUpR (version 0.1.3)

optimal.ira1r1: Model 1.0: COSA Solver for Individual Random Assignment Designs, Completely Randomized Controlled Trials

Description

optimal.ira1r1 finds constrained optimal sample allocation (COSA) solutions for completely randomized controlled trials where individuals are randomly assigned to treatment and control groups. COSA can be found in the following forms, (i) under budgetary constraints given marginal costs per unit, (ii) under power contraints given marginal costs per unit, (iii) under MDES contraints given marginal costs per unit, and (iv) under sample size contraints for one or more levels along with any of the i,ii, or iii options.

Usage

optimal.ira1r1(cn, cost=NULL, n=NULL,
                 power=.80, mdes=.25, alpha=.05, two.tail=TRUE,
                 N0=c(10), ncase=10, gm=10,
                 constrain="cost", optimizer="auglag_cobyla",
                 P=.50, g1=0, R12=0)

Arguments

cn
marginal cost per unit.
cost
total cost or budget.
n
included for consistency, it should remain NULL.
power
statistical power (1 - type II error).
mdes
minimum detectable effect size.
alpha
probability of type I error.
two.tail
logical; TRUE for two-tailed hypothesis testing, FALSE for one-tailed hypothesis testing.
N0
starting values for n.
ncase
number of cases to show in the output.
gm
grid multiplier to increase the range of sample size search.
constrain
one of the followings can be constrained at a specified cost or value: "cost", "power", or "mdes".
optimizer
algorithm to find optimal sample size given total cost, power, or MDES. Available algorithms: "auglag_cobyla", "auglag_lbfgs", "auglag_mma", or "auglag_slsqp".
P
proportion of units randomly assigned to treatment.
g1
number of covariates.
R12
proportion of variance in the outcome explained by covariates.

Value

fun
function name.
par
list of parameters used in the function.
nloptr
list of nloptr log and output.
round.optim
solution after rounding. MDES is calculated at the specified power (default .80), and power is calculated at the specified MDES (default .25).
integer.optim
best integer solutions around round.optim solution. MDES is calculated at the specified power (default .80), and power is calculated at the specified MDES (default .25).

Details

An optimization is not necessary because the relationship between contraints and optimal sample is straight forward multiplication or division. Therefore use of this function is not recommended. Nonetheless, this function is provided for consistency and convenience. Further definition of design parameters can be found in Dong & Maynard (2013).

References

Dong, N., & Maynard, R. A. (2013). PowerUp!: A Tool for Calculating Minum Detectable Effect Sizes and Minimum Required Sample Sizes for Experimental and Quasi-Experimental Design Studies,Journal of Research on Educational Effectiveness, 6(1), 24-6.

See Also

mdes.ira1r1, power.ira1r1, mrss.ira1r1

Examples

Run this code
## Not run: ------------------------------------
# 
#      optimal.ira1r1(cn=1, cost=560,
#                     constrain="cost")
# 
#   
## ---------------------------------------------

Run the code above in your browser using DataLab