optimal.bira3r1
finds constrained optimal sample allocation (COSA) solutions for designs with 3-levels
where level 1 units are randomly assigned to treatment and control groups within level 2 units (random blocks).
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.
optimal.bira3r1(cn, cJ, cK, cost=NULL, n=NULL, J=NULL, K=NULL, power=.80, mdes=.25, alpha=.05, two.tail=TRUE, nJK0=c(10,10,10), ncase=10, gm=2, constrain="cost", optimizer="auglag_cobyla", rho2, rho3, omega2, omega3, P=.50, g3=0, R12=0, RT22=0, RT32=0)
TRUE
for two-tailed hypothesis testing, FALSE
for one-tailed hypothesis testing."cost"
, "power"
, or "mdes"
."auglag_cobyla"
, "auglag_lbfgs"
, "auglag_mma"
, or "auglag_slsqp"
.Constrained optimal sample allocation (COSA; Hedges & Borenstein, 2014; Raudenbush, 1997; Raudenbush & Liu, 2000)
problems are solved using nloptr
(Ypma, 2014) package, an implementation of NLopt (Johnson, n.d.) in R (R Core Team, 2016).
More specifically, Augmented Lagrangian method is used for global optimization (AUGLAG, Birgin & Martines, 2008; Conn, Gould, & Toint, 1991)
in conjuction with one of the following local optimization algorithms:
Constrained Optimization by Linear Approximations (COBYLA, Powell, 1994),
Low Storage BFGS (LBFGS, Liu & Nocedal, 1989),
Method of Moving Asymptotes (MMA, Svanberg, 2002),
or Sequental Least-Squares Quadratic Programming (SLSQP, Kraft, 1988).
See NLopt website for a brief summary.
nloptr
returns values that are not integer. Rounding may produce cost, power or MDES values different from what was specified.
A better solution is approximated using brute force. If the constrained value (cost, power or MDES)
in the output deviates from what was specified, increasing grid multiplier (gm
) often solves the problem.
More cases can be printed by increasing ncase
.
Further definition of design parameters can be found in Dong & Maynard (2013).
Conn, A. R., Gould, N. I. M., & Toint, P.L. (1991). A globally convergent augmented Lagrangian algorithm for optimization with general constraints and simple bounds. SIAM J. Numer. Anal. 28(2), 545-572.
Dong & Maynard (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.
Hedges, L. V., & Borenstein, M. (2014). Conditional Optimal Design in Three- and Four-Level Experiments. Journal of Educational and Behavioral Statistics, 39(4), 257-281
Hedges, L. & Rhoads, C.(2009). Statistical Power Analysis in Education Research (NCSER 2010-3006). Washington, DC: National Center for Special Education Research, Institute of Education Sciences, U.S. Department of Education. This report is available on the IES website at http://ies.ed.gov/ncser/.
Johnson, S. G. (n.d.). The NLopt nonlinear-optimization package. Package available at http://ab-initio.mit.edu/nlopt.
Kraft, D. (1988). A software package for sequential quadratic programming. Obersfaffeuhofen, Germany: DFVLR.
Liu, D. C., & Nocedal, J. (1989). On the limited memory BFGS method for large scale optimization. Mathematical programming, 45(1-3), 503-528.
Powell, M. J. (1994). A direct search optimization method that models the objective and constraint functions by linear interpolation. In Advances in optimization and numerical analysis (pp. 51-67). Springer Netherlands.
R Core Team (2016). R: A language and environment for statistical computin . R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org.
Raudenbush, S. W. (1997). Statistical analysis and optimal design for cluster randomized trials. Psychological Methods, 2, 173-185.
Raudenbush, S. W., & Liu, X. (2000). Statistical power and optimal design for multisite trials. Psychological Methods, 5, 199-213.
Svanberg, K. (2002). A class of globally convergent optimization methods based on conservative convex separable approximations. SIAM journal on optimization, 12(2), 555-573.
Ypma, J. (2014). nloptr
: R interface to NLopt. R package version 1.0.4. Package available at https://cran.r-project.org/package=nloptr
mdes.bira3r1, power.bira3r1, mrss.bira3r1
## Not run:
#
# optimal.bira3r1(cn=1, cJ=10, cK=100, cost=5600,
# constrain="cost",
# rho3=.20, rho2=.15, omega3=.10, omega2=.10)
#
# ## End(Not run)
Run the code above in your browser using DataLab