JSS Journal of Statistical Software November 2012, Volume 51, Code Snippet 1. http://www.jstatsoft.org/ %GI:A SAS Macro for Measuring and Testing Global Imbalance of Covariates within Subgroups Furio Camillo University of Bologna Ida D’Attoma University of Bologna Abstract The global imbalance (GI) measure is a way for checking balance of baseline covari- ates that confound efforts to draw valid conclusions about treatment effects on outcomes of interest. In addition, GI is tested by means of a multivariate test. The GI measure and its test overcome some limitations of the common way for assessing the presence of imbalance in observed covariates that were discussed in D’Attoma and Camillo (2011). A user written SAS macro called %GI, to simultaneously measure and test global imbal- ance of baseline covariates is described. Furthermore, %GI also assesses global imbalance by subgroups obtained through several matching or classification methods (e.g., cluster analysis, propensity score subclassification, Rosenbaum and Rubin 1984), no matter how many groups are examined. %GI works with mixed categorical, ordinal and continuous covariates. Continuous baseline covariates need to be split into categories. It also works in the multi-treatment case. The use of the %GI macro will be illustrated using two artificial examples. Keywords : global imbalance measure, global imbalance test, subgroups, multi-treatment, SAS. 1. Introduction Assessing balance of non-equivalent groups is fundamental before estimating effects of treat- ments on outcomes of interest, especially in the presence of observational data where the rule that governs treatment assignment is generally unknown, and either units are self-selected into treatments or they are non randomly selected to receive a treatment. Various methods are used to balance groups with unequal distribution of covariates – i.e., matching, cluster analysis, propensity score (PS) adjustments. The most widely used and applied in various fields is the PS adjustment (Rosenbaum and Rubin 1983). PS is the conditional probability that a unit will be assigned to the treatment condition based on a set of observed covariates. Then, propensity score adjustments (e.g., PS subclassification) are used to balance groups