Calculate the optimal sample allocation that produces smallest variance of a treatment effect or the highest statistical power for experimental studies under a budget constraint, perform power analyses with and without accommodating cost structures of sampling, and calculate the relative efficiency between two sample allocations. The references for the proposed methods are: (1) Shen, Z. (2019). Optimal sample allocation in multilevel Experiments. (Doctoral dissertation). University of Cincinnati, Cincinnati, OH. (2) Shen, Z., & Kelcey, B. (in press). Optimal sample allocation under unequal costs in cluster-randomized trials. Journal of Educational and Behavioral Statistics. (3) Champely., S. (2018). pwr: Basic functions for power analysis (Version 1.2-2) [Software]. Available from < https://CRAN.R-project.org/package=pwr>.