Essays in econometrics and industrial organization