This paper studies the links between productivity, innovation and research at the firm level. We introduce three new features: (i) A structural model that explains productivity by innovation output, and innovation output by research investment: (ii) New data on French manufacturing firms, including the number of European patents and the percentage share of innovative sales, as well as firm-level demand pull and technology push indicators; (iii) Econometric methods which correct for selectivity and simultaneity biases and take into account the statistical features of the available data: only a small proportion of firms engage in research activities and/or apply for patents; productivity, innovation and research are endogenously determined; research investment and capital are truncated variables, patents are count data and innovative sales are interval data. We find that using the more widespread methods, and the more usual data and model specification, may lead to sensibly different estimates. We find in particular that simultaneity tends to interact with selectivity, and that both sources of biases must be taken into account together. However our main results are consistent with many of the stylized facts of the empirical literature. The probability of engaging in research (R&D) for a firm increases with its size (number of employees), its market share and diversification, and with the demand pull and technology push indicators. The research effort (R&D capital intensity) of a firm engaged in research increases with the same variables, except for size (its research capital being strictly proportional to size). The firm innovation output, as measured by patent numbers or innovative sales, rises with its research effort and with the demand pull and technology indicators, either directly or indirectly through their effects on research. Finally, firm productivity correlates positively with a higher innovation output, even when controlling for the skill composition of labor as well as for physical capital intensity.Research, Innovation, Patent, Productivity, Demand conditions, Technological opportunities, System of limited dependent and qualitative variables, Asymptotic least squares JEL Classification: C31, C34, L60, O31, O33,