Essays in Econometrics of Networks and Models with Errors-in-Variables