  The Regression Discontinuity Design (RDD) is a quasi-experimental design that
estimates the causal effect of a treatment when its assignment is defined by a
threshold value for a continuous assignment variable. The RDD assumes that
subjects with measurements within a bandwidth around the threshold belong to a
common population, so that the threshold can be seen as a randomising device
assigning treatment to those falling just above the threshold and withholding
it from those who fall just below.
  Bandwidth selection represents a compelling decision for the RDD analysis as
the results may be highly sensitive to its choice. A number of methods to
select the optimal bandwidth, mainly originating from the econometric
literature, have been proposed. However, their use in practice is limited.
  We propose a methodology that, tackling the problem from an applied point of
view, consider units' exchangeability, i.e., their similarity with respect to
measured covariates, as the main criteria to select subjects for the analysis,
irrespectively of their distance from the threshold. We carry out clustering on
the sample using a Dirichlet process mixture model to identify balanced and
homogeneous clusters. Our proposal exploits the posterior similarity matrix,
which contains the pairwise probabilities that two observations are allocated
to the same cluster in the MCMC sample. Thus we include in the RDD analysis
only those clusters for which we have stronger evidence of exchangeability.
  We illustrate the validity of our methodology with both a simulated
experiment and a motivating example on the effect of statins to lower
cholesterol level, using UK primary care data.
