Essays on the econometrics of causal inference, resampling and spatial dependence