Kontopantelis, Evangelos. 2013. “A Greedy Algorithm for Representative Sampling: Repsample in Stata”.
Journal of Statistical Software, Code Snippets
55 (1):1-19. https://doi.org/10.18637/jss.v055.c01.