{'fraction_non_alphanumeric': 0.015570934256055362, 'fraction_numerical': 0.0, 'mean_word_length': 6.1419753086419755, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Bound Constrained Optimization of Sample Sizes Subject to Monetary Restrictions in Planning Multilevel Randomized Trials and Regression Discontinuity Studies

Abstract Sample size determination in multilevel randomized trials (MRTs) and multilevel regression discontinuity designs (MRDDs) can be complicated due to multilevel structure, monetary restrictions, differing marginal costs per treatment and control units, and range restrictions in sample size at one or more levels. These issues have sparked a set of studies under optimal design literature where scholars consider sample size determination as an allocation problem. The literature on optimal design of MRTs and MRDDs and their implementation in software packages has been scarce, scattered, and incomplete. This study unifies optimal design literature and extends currently available software under bound constrained optimal sample allocation (BCOSA) framework via bound constrained optimization technique. The BCOSA framework, introduction to the cosa R library, and an illustration that replicates and extends minimum required sample size determination for an evaluation report is provided.