Essays on medical care using Semiparametric and structural econometrics