Essays in panel data econometrics examining selection bias and average treatment effects