PurposeThe objective of this work is to demonstrate the relationships between the two main processes of research and development (R&D) activities: the knowledge generation phase (KPP) and the knowledge commercialization, or transfer, phase (KCP), in a sector that is intensive in this type of activity, such as the pharmaceutical sector. In addition, within the framework of the general objective of this work, the authors propose two other objectives: (1) make advances in network efficiency measurement models, and (2) determine the factors associated with efficiency in the KPP and in the KCP in companies of the pharmaceutical sector in Spain.Design/methodology/approachA Network Data Envelopment Analysis (NDEA) model (Färe and Grosskopf, 2000) with categorical variables (Lee et al., 2020; Yeh and Chang, 2020) has been applied, and a sensitivity analysis of the obtained results has been performed through a DEA model of categorical variables, in accordance with the work of Banker and Morey (1986), to corroborate the results of the proposed model. The sample is made up of 77 companies in the pharmaceutical sector in Spain.FindingsThe results obtained point to a greater efficiency of pharmaceutical companies in the KPP, rather than in the KCP. Furthermore, the study finds that 1) alliances between companies have been the accelerating factors of efficiency in the KCP (but patents have slowed this down the most); 2) the quality of R&D and the number of R&D personnel are the factors that most affect efficiency in the KPP; and 3) the quality of R&D again, the benefits obtained and the position in the market are the factors that most affect efficiency in the KCP.Originality/valueThe authors have not found studies that show whether the efficiency obtained by R&D-intensive companies in the KPP phase is related to better results in terms of efficiency in the KCP phase. No papers have been found that analyse the role of alliances between R&D-intensive companies and patents, as agents that facilitate efficiency in the KCP phase, covering the gap in the research on both problems. Notwithstanding, this work opens up a research path which is related to the improvement of network efficiency models (since it includes categorical variables) and the assessment of the opinions of those who are responsible for R&D departments; it can be applied to decision-making on the aspects to improve efficiency in R&D-intensive companies.