In trials designed to reflect routine care, the cluster-randomized trial is appealing. By randomly assigning interventions to physicians or hospitals instead of directly to patients, routine care settings may be studied under experimental interventions, while problems such as treatment contamination can be prevented. However, the number of clusters being randomized is often relatively small. A study including thousands of patients may have randomized only a dozen hospitals. In this situation, assigning treatments with a simple randomization, e.g., drawing the names of half of the hospitals out of a hat, is unacceptably risky. When the number of units being randomized is small, there is substantial risk that severe imbalance in important covariates will occur by chance.^{1}

Restricted randomization methods are commonly used to reduce this risk. Cluster-randomized trials frequently have the advantage of covariate information being available on all units prior to randomization; those units are randomized all at once or in a few batches. Stratified randomization is a commonly used restricted randomization method that creates strata based on a few important covariates and then randomly assigns half of the units in each stratum to one treatment and half to the other. While providing some benefit, this approach is limited to including only a few of the important covariates and the categorization of continuous covariates into a few bins. In spite of its limitations, the general concept is sound. The ideal stratification would contain exactly two similar units within each stratum. Matching prior to randomization achieves this without requiring categorization of continuous covariates, without severely limiting the number of covariates being balanced, and without requiring units that match perfectly to achieve balance between the study arms.

The benefits of any restricted randomization method depend on its ability to balance important covariates, the strength of the association between the covariates and the outcome, and the study’s sample size. In a non-clustered study of 132 patients randomly assigned treatment, Greevy et al. demonstrated that optimal nonbipartite matching on the Mahalanobis distance derived from 14 covariates resulted in an average increase in power equivalent to a 7% increase in sample size.^{1} Moreover, this approach eliminated the rare but severe imbalances that may occur with simple randomization. Despite the method’s superior performance, it presently remains less widely used than simple or stratified randomization. In cluster-randomized trials, wider adoption has been hindered by misunderstandings about matching and an absence of user-friendly tools to implement the method.

In their 2009 paper, Imai et al. dispel the major misconceptions surrounding matched-pair cluster-randomization (MPCR).^{2} For example, they examine the assumptions leading Martin et al. to recommend against MPCR in small samples.^{3} When the assumption of equal cluster sizes is relaxed, as is appropriate for most practical scenarios, the MPCR that matches on cluster size and pre-treatment covariates will improve the study’s efficiency and power over unmatched cluster-randomization, even with as few as six clusters. In a discussion of Imai et al.’s paper, Zhang and Small show the utility of optimal nonbipartite matching for achieving pre-treatment covariate balance in MPCR and for optimally selecting a set of units for study when the number of units available is greater than the number needed.^{4} For observational studies utilizing matching, Rosenbaum presents a method of augmenting the distance matrix to optimally choose the number of units to study for a specified level of quality of match.^{5} When the quality of matches is of greater concern than the exact number of units included, this approach can be very useful in the MPCR setting. Both approaches are incorporated into the methods presented here.

To fully realize the benefits of MPCR with several pre-treatment covariates, including continuous measures and cluster size, a multivariate distance measure is needed. To balance the cluster-specific covariate distributions, appropriate summary measures are chosen. Categorical variables may be summarized with proportions, e.g., the percentage of patients taking statins. Likewise, when the shape of the distributions is not highly variable, a single summary measure may suffice for continuous covariate distributions, e.g., mean low-density lipoprotein (LDL). Otherwise, multiple measures may be used, e.g., the mean and standard deviation of LDL or the 10^{th}, 50^{th}, and 90^{th} percentiles. Once a continuous multivariate distance measure is developed, the optimal set of matches is the set that minimizes the average distance between pairs. Lu et al. recently released an R package and web application that takes a user-created matrix of distances between units and solves for the optimal matches.^{6} However, the creation of the distance matrices may create an obstacle for some researchers, and improving the utility of distance measures is an open area of research.

This paper addresses the need for a customizable distance measure that incorporates clinical and other knowledge regarding the importance of the covariates while also allowing the inclusion of covariates with missing values. The method we propose may incorporate two ways to exclude units when more units are available than can be included in the study. We introduce two user-friendly tools to implement the methodology in the form of a web application and an R package. To aid the development of the distance measure, the web application includes tools for assessing the quality of the matches prior to randomization and comparing them to benchmark values to assist the user in choosing covariate weights. Once the choice of weights has been finalized, the application allows the user to perform the official randomization with a user-specified random seed to allow reproducibility and, if needed, the randomization of additional study units to be added after the first set of treatment assignments has been made. The web application and instructions on downloading the R package nbpMatching are available at

http://biostat.mc.vanderbilt.edu/MatchedRandomization. Examples using real data from VHA sites are presented to illustrate the method.