Doraszelski, Ulrich and Jaumandreu, Jordi (2006): R&D and productivity: Estimating production functions when productivity is endogenous.