Randomization code (from Hsiang and Jina, 2014)

This function performs a series of randomization tests for exploring model-generated bias in panel data models. It randomizes a treatment variable in three different ways and stores coefficients from the same model after randomization. Coefficients can then be plotted to see how the randomized distribution compares to the original point estimates.