Panel data models with unobserved effects and endogenous explanatory variables