Essays in nonparametric econometrics