Innovation spillovers and firm performance: micro evidence from Spain (2004–2009)

This article analyses the impact that R&D expenditures and intra- and inter-industry externalities have on the performance of Spanish firms. Despite the extensive literature studying the relationship between innovation and productivity, there are far fewer studies in this particular area examining the importance of sectoral externalities, especially focused on Spain. One novelty of this study, conducted for the industrial and service sectors, is that we also consider the technology level of the sector in which the firm operates and firm size. The database used is the Technological Innovation Panel. It comprises 9985 firms over the period 2004–2009 and has been used infrequently for studies of this type. The Olley and Pakes (Econometrica 64:1263-1297, 1996) estimator is adopted in order to account for both simultaneity and selection biases providing consistent estimates. The results suggest that, unlike previous studies, R&D expenditures do not have a direct impact on firm performance. By contrast, spillovers do. In particular, intra-industry externalities present a positive and significant effect in low-tech and large firms. Inter-industry externalities, however, present an ambiguous effect and there appears to be no specific pattern of behaviour associated with technology level or firm size.


Introduction
It is widely acknowledged that if a firm can increase its productivity it is likely to gain in competitiveness, an essential attribute in today's globalized world. This is of particular relevance in the case of Spain, because even though productivity has increased in recent years ( Fig. 1), this growth is largely attributable to a drastic reduction in employment (see Table 1).
As shown in Fig. 1, up to 2007, Spanish firms presented lower rates of labour productivity (defined as the ratio between GDP and number of employees) growth than those recorded by their European counterparts (both EU-27 and EU-15). Since that date, however, Spain's growth rates have risen notably taking them to the top of Europe's rankings, with the exception of 2010. This might suggest successful adaptation to the economic crisis; but, the reality is quite different. As can be seen in Table 1, Spain's GDP growth rate has been similar to or even lower than Europe's in recent years, while the fall in employment in Spain has been much greater than that recorded in the rest of the continent since 2008. As a result, Spanish firms need to take steps towards increasing their productivity by raising production, as opposed to via the destruction of jobs.
In recent decades, the number of studies examining the relationship between innovation and firm productivity has increased (see following section for a literature review). In general, the findings stress the importance of R&D as a determinant of economic performance. Yet, as Fig. 2 highlights, Spain's business R&D to GDP ratio is much lower than that of the European Union and, moreover, since 2008 it has gone into decline.
Therefore, examining Spain's R&D-productivity relationship in greater depth is essential if we are to further our understanding of it and if we hope to design policies that can raise productivity, especially in the current economic climate. For this reason, the primary goal of this paper is to analyse the relationship between R&D and firm performance in Spain over the last few years. In the light of previous studies that report differences in the productivity gains attributable to innovation in accordance with a firm's level of technology and size, and given that few studies of the Spanish case take these two factors into account, here we assess whether differences can be found between highand low-tech firms, as well as between small and large firms. 1 Additionally, it should be borne in mind that the knowledge derived from a firm's investment in innovation is likely to spill over, given its inability to reap all the benefits from its investment. Therefore, when examining the impact of innovation on productivity, the diffusion of the innovation and any externalities generated also need to be taken into account. Several papers have analysed the importance of spillovers; however, there has been little discussion about this aspect from a sectoral perspective, particularly in Spain. Thus, the second goal of this paper is to study the extent to which a firm's performance is influenced by the innovation carried out by other firms in the same sector (intra-industry externality) or by the innovation activities of firms in other sectors (inter-industry externality). Source: Eurostat; own representation 1 It should be mentioned that Goya et al. (2012) carry out a similar analysis; however it is a much basic work using cross-section data for 2010. In the present paper we use panel data and we are able to capture changes over time as well as tackle several problems that appear when a productivity analysis is undertaken. Unobserved heterogeneity or simultaneity issues need to be taking into account since they might be affecting the relationship between innovation and productivity. The estimation method used here (Olley and Pakes 1996) account for these problems providing consistent results. The study is conducted using the Technological Innovation Panel (PITEC) database, an unbalanced panel of 9985 Spanish firms from both the industrial and service sectors for the period [2004][2005][2006][2007][2008][2009]. It should be stressed that the study breaks new ground, since not only examines the situation for the whole country but also for the industrial and service sectors. By doing so, it aims to overcome a severe limitation given that most studies to date have focused solely on the manufacturing sector or have covered only a specific region (as we shall see below). In addition, PITEC contains a high level of sectoral information which enables us to focus our attention on inter-industry externalities as well. Finally, the Olley and Pakes (1996) estimator is adopted in order to account for unobserved heterogeneity, simultaneity issues and selection bias. These are common problems that arise when a productivity analysis is carried out. However, by using this method, consistent and reliable coefficients can be obtained.
To sum up, the aim of this paper is twofold. First, it seeks to analyse the extent to which the technology level 2 and size of Spanish firms affect the impact that R&D expenditures might have on firm performance over the period [2004][2005][2006][2007][2008][2009]. In other words, it investigates if there are differences regarding the contribution of R&D in firm performance between low-tech and high-tech firms as well as between small and large firms. Second, it assesses how these factors influence potential knowledge flows from other firms' innovations, both intra-and inter-industry externalities. Thus, this article aims to answer the following questions: (1) Does the impact of R&D on firm performance differ according to a firm's technology level and/ or firm size? (2) Are Spanish firms able to benefit from externalities? (3) And if so, do these benefits vary according to a firm's technology level and/or firm size? This paper has been organized as follows. Section 2 examines the previous literature, Sect. 3 presents the theoretical model, Sect. 4 describes the database and empirical model, Sect. 5 presents the results, and finally the conclusions are drawn in Sect. 6.

Previous literature
A considerable body of literature has been published since Griliches (1979Griliches ( , 1986 first examined the link between innovation and productivity. The well-known Cobb-Douglas production function is normally used to conduct the empirical analysis, with the traditional inputs of physical capital and labour being extended to include innovation expenditures. In general, the evidence reveals a positive and significant relationship between innovation and productivity at the firm level (see Mairesse and Sassenou 1991 for a detailed study, and also-to name but a few- Hall and Mairesse 1995 for France;Harhoff 1998 for Germany; Lotti and Santarelli 2001 for a comparative study of Germany and Italy; Parisi et al. 2006 for Italy andBallot et al. 2006 for France and Sweden). However, the results obtained seem to depend on the geographical area being analysed as well as on the nature of the database and methodology used.
It is worth mentioning that most of these articles undertake cross-country analyses, and pay scant attention to the impact that a firm's sector or size might have. As stressed in the previous section, our primary goal is to determine whether there are any differences in the impact of innovation on firm performance according to these factors. Empirical evidence to date suggests that the impact of R&D expenditures on a firm's productivity is more marked in high-tech sectors than it is in their low-tech counterparts (see Verspagen 1995 for nine OECD countries; Tsai and Wang 2004 for Taiwan;Ortega-Argilés et al. 2010 and 2011 for European firms). As regards firm size, we are interested in determining whether size influences the returns firms obtain from innovation, taking into consideration that the larger the firm, the more innovation it is likely to conduct (see Huergo and Jaumandreu 2004). However, very little research has been published in the literature on this question. According to Castany et al. (2009), the size of Spanish firms does have an influence on the returns obtained from investment in both innovation and human capital, with the largest firms being the ones that benefit most from these investments.
In addition, this article seeks to determine if the stock of knowledge available at the firm level is dependent on both the firm's own innovation or on externalities. As discussed above, the benefits derived from innovation in a firm (or sector) are likely to spill over because of the firm's inability to channel all of the benefits obtained from its investment effort. Thus, a firm's performance can be explained by its own knowledge as well as by the knowledge generated somewhere else which is in the public domain. For this reason, externalities need to be taken into consideration.
From an empirical perspective, most articles employ a production function where spillovers are included as an additional input (following Griliches 1979). Although there has been a considerable number of studies that have analysed the impact of R&D spillovers on productivity, a general consensus has yet to be reached on just what that effect might be. Despite the positive impact reported by some authors (Griliches 1992;Nadiri 1993;Cincera 2005;Wieser 2005;Aiello and Cardamone 2005;Cardamone 2012;Bloch 2013) Medda and Piga 2014 for Italy). Overall, the evidence is unclear, with spillovers having an apparently heterogeneous effect (being positive, negative or not significant). Yet, it should be borne in mind that the results are conditioned by the sector or country under analysis and that they are highly dependent on the way in which externalities are quantified (using technological similarity, geographical distance or commercial relations).
As far as Spain is concerned, the relationship between innovation and productivity has been examined by a number of authors, who conclude that innovation has a positive impact on productivity. However, a general limitation of most of these studies is that their analyses are restricted to manufacturing firms based on the Encuesta sobre Estrategias Empresariales dataset (ESEE). 3 Among the most recent papers employing this database we find Vivero (2002), Huergo and Moreno (2004), Huergo and Jaumandreu (2004), Rodríguez-Fernández (2002, 2008), Rodríguez-Fernández and Maté-García (2006), Rochina-Barrachina et al. (2010) and Cassiman et al. (2010), to name but a few. By contrast, only a few papers have carried out a joint analysis of both manufacturing and service sectors, most notably Segarra-Blasco (2010) and Segarra-Blasco and Teruel (2011) who analyse the case of Catalonia using data from the fourth Community Innovation Survey (CIS4).
In the case of external knowledge, far too little attention has been paid to the effect of spillovers on the productivity of Spanish firms. Some articles, including Ornaghi (2006), argue that externalities are positive and significant in explaining productivity. In this study the impact of spillovers on productivity growth is examined in 3151 manufacturing firms from 1990 to 1999. Spillovers are measured by taking into account firm size and the results indicate a positive impact of technological externalities on growth in productivity. However, the results in other studies differ according to the economic sector in which the firm operates and its level of technology. For instance, Beneito (2001) analyses the impact of intra-industry externalities on productivity for 501 Spanish manufacturing firms distinguishing them according to technology level during the period 1990-1996. The author concludes that only firms using advanced technologies are able to benefit from the knowledge in their technological neighbourhood. In particular, the spillover effect depends on the intensity of R&D, with firms in the intermediate quartile being the ones that experience the largest productivity gains.
All in all, the question that still needs to be addressed is whether differences are to be found in the returns that Spanish firms obtain from their innovation investments in relation to their technology level or firm size. In addition, given the paucity of studies assessing the impact of spillovers in Spain, this paper will examine if firms in the sample are able to benefit from the innovation carried out by others.

Economic model
The model adopted to estimate the relationship between innovation and firm performance is the extended Cobb-Douglas production function, which apart from including conventional production factors (physical capital and labour) also incorporates human capital and innovation. 4 In line with previous studies, 5 it is believed that the more qualified workers the firm has, the more effectively they are likely to perform their tasks and the more productive the firm is likely to be. Additionally, innovation, the variable of interest in this study, has been included as a production input. Investment in innovation can reduce costs of production or raise firm sales, thus increasing production.
where Y ist is the output of firm i belonging to sector s at year t, A ist is the firm's technology level, K ist is physical capital, L ist is labour, H ist is human capital, I ist is innovation and b 1 , b 2 , b 3 , b 4 are the returns on each variable respectively.
Following Goya et al. (2012), it is assumed that firm's level of technology is dependent on the innovation made by all the other firms: where A is a constant denoting a common technology level for all the firms; S intra ist is the intra-industry externality of firm i in sector s capturing the innovative effort made by all the other firms in the same sector; and S inter ist is the interindustry externality understood as the innovation made by the firms in the rest of the sectors.
Thus by combining Eqs. (1), (2) it can be seen that a firm's output is explained in terms of its own investments (in physical capital, human capital and innovation) and of the knowledge generated outside the firm: Therefore, under the assumption that / 1 = 0 and / 2 = 0, even though a firm does not invest in innovation, it can still benefit from the innovation carried out by all the other firms and, thereby, increase its performance.
4 Data and empirical model

Data: technology innovation panel (PITEC)
In the empirical analysis we use PITEC, which provides information on the innovation activities of Spanish firms for the period 2003-2009. 6 The National Institute of Statistics (INE), in consultation with a group of experts and under the sponsorship of the Spanish Foundation for Science and Technology (FECYT) and the Foundation for Technological Innovation (COTEC), is responsible for building up this database. PITEC is built upon the Spanish Innovation Survey carried out by the INE, which in turn is based on the Community Innovation Survey (CIS) which follows guidelines laid down by the OECD's Oslo Manual and, through the use of a standardized questionnaire, enables comparisons to be made between countries. PITEC is a data panel based on a representative selection of firms, which makes it possible to carry out repeated observations of the economic units included over time and thereby develop much more precise estimations of the evolution of R ? D ? I activities in the business sector (innovation expenditures, composition of the samples, etc.), determine the impact of innovation (different effects on productivity) and identify the various strategies in the decisions adopted by firms when introducing innovations into their business (for instance the different compositions of internal and external R&D expenditures as a part of total expenditures). The panel is made up of four non-excludable samples: (1) firms with 200 or more employees, (2) firms with internal R&D expenditures, (3) firms with fewer than 200 employees with external R&D expenditures but which carry out no internal R&D, and (4) firms with fewer than 200 employees with no innovation expenditures.
Although PITEC has provided statistical information since 2003, in this paper we only draw on data for the period 2004-2009. 7 After a filtering process, 8 only firms with ten or more employees 9 operating in the industrial and service sectors were selected (primary sector and construction were thus excluded). Note that the influence of extreme outliers in the sample was treated accordingly (see ''Appendix 1''). Our eventual sample consisted of an unbalanced panel of 9985 firms (51,604 observations).
PITEC provides information on individual firm characteristics (sales, exports, employment, the market in which a firm operates, industry sector, etc.) along with detailed information on innovation activities, such as different types of innovation expenditures, cooperation between firms, barriers to innovation and number of patents, etc.
There is a double advantage of using this database. Firstly it provides information on both the industrial and service sectors, making possible to overcome the limitation that most studies in Spain focus solely on the manufacturing sector, generally using the ESEE. Secondly, it contains a high level of sectoral information covering 51 sectors (see ''Appendix 2''). This level of detail enables a rich study to be undertaken examining differences in behaviour between sectors with different technology levels and, in turn, making a more interesting study of inter-industry externalities possible.
In line with the aim of this paper and for the purposes of analysing whether the impact of innovation and externalities on firms performance vary depending on the sector's technology and firm size, the total sample of 9985 firms has been divided up according to the technology level of the sector in which the firm operates and also according to firm size. In the first case, we have used the Eurostat classification and grouped the firms by sector into the following categories: (a) low and medium-low tech manufacturing firms (LTMI), (b) medium-high and high-tech manufacturing firms (HTMI), (c) non-knowledge-intensive services (NKIS) and (d) knowledge-intensive services (KIS). In the second case, we have distinguished between: (a) small firms (from 10 to 49 employees), (b) medium-sized firms (from 50 to 199 employees) and (c) large firms (200 or 6 Last year available when this paper was written. 7 We do not use data for 2003 because of its severe limitations. PITEC began with just two samples in 2003 (a sample of firms with 200 or more employees and a sample of firms with internal R&D expenditures). In 2004, it overcame this limitation by including a sample of firms with fewer than 200 employees with external R&D expenditures but which carried out no internal R&D and a sample of firms with fewer than 200 employees with no innovation expenditures. 8 This filtering process meant eliminating those observations that included any kind of 'incident' (i.e., confidentiality problems, takeovers, mergers, etc.) and those containing obvious anomalies (such as null sales). 9 The population area is as defined by the Spanish Innovation Survey on which PITEC is based. J Prod Anal (2016) 45:1-22 5 more employees). To see the distribution of firms according to sub-samples see ''Appendix 3''.

Empirical model and estimation issues
According to the expression (3), and using the information supplied by the PITEC database, 10 the following econometric model can be specified: where y ist approximates the sales, k ist is the physical capital stock, l ist is the number of employees, h ist is the percent age of employees with higher education, and i ist is defined as R&D stock. 11 S intra ist and S inter ist are the externalities defined below. The regression controls are represented by technology level and firm size dummies and also a trend to capture time changes. 12 On the other hand, x ist is the productivity shock and e ist is the error term (which can contain unpredictable productivity shocks). Lower case letters indicates log-transformed variables (with the exception of human capital which is a percentage). All monetary variables are expressed at constant values at 2009 base prices (nominal values have been deflated using the GDP deflator).
As is widely accepted in the literature, 13 a firm's output is assumed to be affected by accumulated stocks of physical capital and R&D expenditures, rather than by current flows. We use the well-known perpetual inventory method: and with t = 2004, …, 2009 h = 1, 2, 3, 4, s = 1,…, 51. Where C t is the real investment in material goods and RD t are the real R&D expenditures. We applied different depreciation rates according to the technology level (h). Following Ortega-Argilés et al. (2011), the more advanced the sector, the faster is the technological progress accelerating the obsolescence of its current physical capital and knowledge. Thus, we applied sectoral depreciation rates of 6 and 7 % for physical capital (d k h Þ and 15 and 18 % for innovation (d h i ) to low-tech and high-tech sectors respectively. 14 In the case of growth rates, if we used the initial periods for their computation, we would lose a considerable amount of information given that our panel has a short time dimension (2004)(2005)(2006)(2007)(2008)(2009)). Thus, we opted to calculate g s k and g s i as the average rate of change in real investment in material goods and real R&D expenditures in each sector(s) over the period 1995-2003. 15 We used the OECD's ANBERD database to calculate physical capital growth rates (g s k ) and the OECD's STAN database for innovation growth rates(g s i ). As regards externalities, due to the many different ways in which spillovers can occur (learning what other firms do either via the movements of workers themselves or through reading articles in journals, attending conferences, disclosure of patents, reverse-engineering, etc.), measuring them is a far from easy task. We follow the definition adopted by Goya et al. (2012) where the authors use R&D expenditures to proxy external knowledge.
Thus, intra-industry externality is defined as: where I jst is total R&D stock carried out in sector s at time On the other hand, it can be supposed that firms which maintain commercial relationships benefit from the knowledge embodied in the products in which they trade. Thus, the more they buy and sell, the more they benefit from the knowledge originated in the other sector. Therefore, interindustry externality is defined in the following way: where I jmt is R&D stock undertaken in all the other sectors and w sm is defined as the quotient between the intermediate purchase by sector s of goods and services supplied by sector m and the total sum of intermediate purchase of sector s. Thus, the influence that the R&D expenditures of firms in sector m have on the productivity of firm i in sector s is based on the relative importance that sector m has as supplier to sector s. To construct the weights we use the symmetric input-output table for Spain for 2005 (the latest year available). An exercise of correspondence has had to be carried out between the branches of business activity according to which PITEC data are classified and the branches of business activity in the input-output table.
As it has been seen in the literature review, both positive and negative coefficients are possible. On the one hand, an external pool of knowledge is expected to have a positive impact on the production of other firms, since they can benefit from new knowledge and ideas. However, on the other hand, if rival firms increase their R&D investment a competitive effect might appear. This is what some authors have called ''market-stealing effect'' (De Bondt 1996;Bitzer and Geishecker 2006;Bloom et al. 2013). Therefore, both possibilities need to be taken into consideration.
As can be seen in expression (4), both externalities have been lagged two periods, since the assumption of a contemporary relationship between them and firm performance seems inappropriate, given that there is no immediate impact. On the contrary, it is likely that the diffusion of external knowledge takes some time before it can affect the firm.
As far as the estimation method is concerned, it is wellknown in the literature that estimates from a production function may suffer from simultaneity as well as selection bias. As such, OLS estimates are biased and inconsistent.
The former problem, simultaneity (first noted by Marschak and Andrews 1944), arises because productivity shocks (x ist ) are known to the firm but not to the econometrician. Thus, when the firm has to determine the usage of inputs its decision is influenced by its beliefs about productivity. Therefore, input choices will be correlated with productivity shocks. So if a firm faces a positive (negative) productivity shock, its use of inputs is going to increase (decrease) accordingly. Not taking this issue into consideration leads to biased and inconsistent estimates since the error term is correlated with the explanatory variables (breaking one of the basic hypotheses of OLS). The second problem, selection bias, manifests itself because of the exit of inefficient firms (not randomly). A firm with higher capital is expected to obtain higher profits in the future and so is more likely to stay in the market despite a negative productivity shock (given that in the future it is thought it will produce more) than a firm with lower capital. 16 In order to deal with these problems and to ensure the reliability of the coefficients we use the estimator proposed by Olley and Pakes in 1996 (hereafter OP). Other methods are employed in the literature, but they only address simultaneity bias. 17 In contrast, the OP estimator addresses both simultaneity as well as selection bias. 18 For this reason, this estimation method has been used by several authors who seek to analyse, for instance, the impact of trade and tariffs on firm productivity (see for example, Pavcnik 2002;Schor 2004;Amiti and Konings 2007;De Loecker 2007;Luong 2011;Van Beveren 2012;Arvas and Uyar 2014). While it is true that it is not one of the most common approaches in the innovation literature, some papers have recently applied this estimator to obtain unbiased and consistent estimates of the production function (see Marrocu et al. 2011; Añón-Higón and Manjón-Antolín 2012).

Olley and Pakes (1996) estimator
Intuitively, the idea behind the OP method is to make ''observable'' the ''unobservable''; in other words, to use an equation to proxy for the unobserved productivity shock. By doing so, the econometrician can control for the correlation between the error term and the inputs and obtain consistent results. Below, the main features of the OP approach are described (using the same notation as that employed by Olley and Pakes 1996). 19 After that, the 16 Even though the evidence suggests that simultaneity bias is more important than selection bias, the estimator used here controls for both. 17 As shown in the literature, simultaneity problems can be addressed by using instrumental variables or fixed effect estimators. However, given that the panel is short and instrumental variables use lagged values as instruments, their suitability is reduced (facing a problem of weak instruments). The fixed effects estimator, on the other hand, relies on the assumption that productivity shocks are constant over time, which is an excessively strong premise from our point of view, especially bearing in mind the economic situation in the period under analysis. 18 Another option might be the Levinsohn and Petrin (2003) estimator, but intermediate inputs are needed in this case (and this information is not provided by PITEC). Thus, we strongly believe that the best option available is the OP estimator. 19 For a detailed explanation of the equations and estimation strategy see Olley and Pakes (1996). changes introduced in order to adapt the method to our case are explained.
First of all, Olley and Pakes base their analysis on the traditional Cobb-Douglass production function: where the log of output (y it ) is explained by the age of the firm (a it ), the log of capital (k it ), the log of labour (l it ) and an error term (e it ) that is decomposed in two components: a productivity shock (x it ) and a measurement error term or unexpected productivity shock (g it ). The former is observed by the firm but not by the econometrician and affects the firm's decision, while the latter is unobserved by both and does not affect the firm's decision.
As for the inputs in the production function, the authors differentiate between variable factors (such as, l it ), which can be easily adjusted given a productivity shock, and fixed factors (also known as ''state variable'') which depend on information from the previous period and are costly to adjust with productivity shocks (k it and a it ).
As explained by the authors, at the beginning of every period an incumbent firm has to decide whether to exit or to continue in the market. The firm remains in the market if the current state variables indicate that the returns of staying in the business are higher than the sell-off value. This is known as the ''exit rule'' and is specified as follows: where v t is an indicator function that takes a value of 1 if the firm remains in the market and 0 if the firm exits and x is a productivity threshold that depends on the firm's capital and age. If the firm continues in the market, it chooses a level of inputs (l it ) and a level of investment according to x it , k it and a it . This is known as the ''investment decision rule'': Provided that i [ 0 and investment is increasing in productivity, the investment function can be inverted as follows: As the authors put it ''[this expression] allows us to express the unobservable productivity variable, x t , as a function of observables, and hence to control for x t in the estimation'' (Olley and Pakes 1996, page 1275).
The production function can then be rewritten as: Þand is approximated by a third-order polynomial series in age, capital and investment. 20 Equation (13) can be consistently estimated by OLS since / Á ð Þ controls for unobserved productivity and, therefore, the inputs are no longer correlated with the error term.
From Eq. (13) we can identify b l but not b a or b k . To do so, estimates of the survival probabilities are needed. The following probit model is fitted: where P t is the probability of the firm surviving in the market and J t-1 is the information available at time t-1.
To compute these probabilities the exit rule defined in Eq. (11) is employed (v t = 1). Thus, the probability of survival in period t depends on age, capital and investment in t-1 using the same third-order polynomial as before. Finally, estimated coefficients of age (b a ) and capital (b k ) are obtained running non-linear least squares usingb l , / andP: where g Á ð Þ accounts for the selection bias by using a thirdorder polynomial inP it and/ tÀ1 À b a a itÀ1 À b k k itÀ1 . The function g Á ð Þ is comparable to the inverse Mills ratio used in Heckman type models.
To summarize, the OP methodology comprises three stages. The first one controls for unobserved productivity shocks including the inverse of the investment demand function in the estimation. Thus, as the error term is no longer correlated with the inputs, the simultaneity bias can be removed. The second estimates the survival probabilities in order to address selection bias. The third and final stage obtains the coefficients of the state variables (b a and b k ) by including the survival probabilities and the inputs estimates computed in the previous steps.
We modify this method slightly to adapt it to our specific requirements. First of all, age is not included in the analysis since this information is not available for all firms. 21 Second, R&D expenditures are incorporated in the analysis. We follow Amiti and Konings (2007) 22 and include R&D stock as a state variable since treating it as exogenous is inappropriate. As with physical capital, we assume that the decision to invest in R&D is taken in t -1. Thus, the investment demand function depends on: The rest of the procedure is the same as described above, apart from the fact that we include rd it as state variable instead of a it . Tables 2, 3 show the descriptive statistics for the main variables in the model across the different technology levels and firm sizes.

Descriptive statistics
First, it can be seen that sales in manufacturing firms vary slightly with the level of technology. However, in the case of the service sector, firms that operate in non-knowledge-intensive services present higher sales than those reported by their counterparts operating in knowledge-intensive services. In the case of capital stock, lowtech firms (LTMI and NKIS) show a somewhat higher ratio than that recorded by high-tech firms (HTMI and KIS). As expected, firms belonging to service sector are larger (higher number of employees) than manufacturing firms. As far as human capital is concerned, the average percentage of qualified employees is much higher in more advanced firms. Specifically, in knowledge-intensive services approximately 42 % of workers have completed higher education. R&D stock is also greater in technologically advanced firms (in both the industrial and the service sectors). In particular, firms belonging to non-knowledge-intensive services are the ones that invest least in R&D. On the other hand, in both sectors, firms present higher capital stock than R&D stock. This differential is most marked in low tech-firms (13.8 vs 10.3 in the industrial sector and 13.6 vs 4.9 in the service sector). Thus, low-tech firms would appear to be much more capital intensive than their hightech counterparts. Finally, the intra-industry externality presents much greater values in high-tech firms (HTMI and KIS), while inter-industry externality shows a more uniform distribution.
In order to test whether there are differences in sales according to technology level, we conducted a Kruskal-Wallis test. 23 The result clearly rejects the null hypothesis (p value = 0.0001) of equal population medians. 24 Sales (y ist ), capital stock (k ist ), labour (l ist ), and R&D stock (i ist ), are taken in logarithms, while human capital (h ist ) is a percentage. Between variation means variation across individuals and within variation means variation over time around individual mean Table 3 shows that the larger the firm, the greater sales it has and the more capital intensive it is. By contrast, the larger the firm, the less human capital it has. As for R&D stock, medium-sized firm are the ones that most invest in R&D, followed by small and large firms respectively. Finally, the smaller the firm, the greater value of intraindustry externalities it presents, while in the case of interindustry externalities, the highest coefficient is for medium-sized firms, followed by small and large companies.
We also tested whether median sales varies by firm size and, again, the Kruskal-Wallis test rejects (p value = 0.0001) the null hypothesis of equal medians.
In addition, from Tables 2, 3 it can be seen that between variation, i.e. variation across individuals, is much higher than within variation, i.e. variation over time for each individual (around individual mean).
Before showing the results, we present the density functions of the logarithm of sales according to technology level and firm size.
In Fig. 3 it can be seen that the density functions vary according to the level of technology where the firm operates; however, no clear pattern can be drawn. Nevertheless, Fig. 4 shows clear differences in the density functions depending on the firm size. Thus, the density functions move further right as the size increases. Therefore, small firms present a density function further to the left on the graph, which indicates lower level of sales. This is followed by the medium-sized firms and large firms that present, on average, higher sales, but they present greater dispersion too.
Therefore, these graphs show that without taking other factors into account, firm sales are distributed differently depending on the technology level or firm size. In particular, firm size has a clear positive influence on firm sales as the density function moves rightwards towards greater size, therefore reaching higher levels.

Estimates
In this section we present the results of the estimates of Eq. (4). For this we use the OP estimator using the ''opreg'' command from Stata (Yasar et al. 2008) to account for the existence of simultaneity and selection bias. To derive the OP estimator, we define physical capital stock and R&D stock as ''state variables'' (since they are quasi-fixed inputs), we consider labour, human capital and externalities as ''free'' inputs, the investment in both physical capital and R&D is our ''proxy variable'' (or in other words, the variable that controls for unobserved productivity) and finally, the remaining variables are controls. Table 4 presents the main results, while intermediate results from the first and second stage of the model can be found in ''Appendix 4''. Table 4 shows the results of the estimation for the sample as a whole and for the sub-samples (i.e., according to the technology level of the sector in which the firm operates and according to the firm size). Our aim is to determine whether there are differences in the returns firms obtain from their own R&D expenditures and those obtained from externalities.
First, when examining sample as a whole (column 1), capital stock (k ist ) has a positive impact on firm performance. The same result can be observed when we disaggregate the sample by technology level (columns 2-5), except for nonknowledge-intensive services. On the other hand, firm size (columns 6-8) appears to have a positive influence, i.e., the larger the firm, the more benefits it obtains from its physical capital stock. Second, the results presented in Table 4 show a positive elasticity regarding the number of employees (l ist ) and, in consonance with previous research, our findings highlight the role played by human capital (h ist ) in all subsamples, especially in low-tech firms (both LTMI and NKIS). The breakdown by firm size illustrates that human capital appears to increase their effect with this factor, thus the larger the firm, the greater its impact.
In line with the literature, R&D stock (i ist ) has a positive impact on the sample as a whole. However, once technology level or firm size is taken into account, this effect disappears. Although this finding is not common in the literature, it is not as counterintuitive as it might seem at first glance. In particular, this result is in line with the new approach introduced by Crepon et al. (1998). In their seminal paper the authors argue that R&D expenditures do not have a direct effect on firm productivity, or as the authors say ''we explicitly account for the fact that it is not innovation input (R&D) but innovation output that increases productivity'' (page 116). To sum up, 25 the idea is the following: it is the firm's capacity to generate innovations and its ability to translate innovations into economic performance, rather than R&D investment itself, that might have an impact on the firm's production. It is our belief that this line of thinking is quite logical and, moreover, it helps shed light on the results obtained here.
As for the intra-industry externalities, although very small, they present a negative coefficient in the sample as a  Capital stock (k ist ), labour (l ist ), human capital (h ist ), R&D stock (i ist ), intra-industry externality (S intra istÀ2 ), inter-industry externality (S inter istÀ2 ) Italic values refer to the number of firms and observations LTMI Low and medium-low tech manufacturing firms, HTMI medium-high and high tech manufacturing firms, NKIS non-knowledge-intensive services, KIS knowledge-intensive services *** Significant at 1 %, ** significant at 5 %, * significant at 10 % 25 It should be borne in mind that the aim here is not to compare the two approaches, but rather to provide a plausible explanation for the results obtained. whole (column 1). Thus, if the rest of the firms in the same sector increase their R&D expenditures, the production of the firm falls. Although if other firms invest in R&D, the pool of knowledge available in the sector will rise, a competition effect may also appear as firms might be rivals. This could compensate for, or even come to dominate (as in this case), the benefits derived from the R&D investment of others, suggesting the existence of a ''market-stealing effect''.
The breakdown by technology level illustrates that, in general, intra-industry externalities have a positive effect on firm sales, except in the case of firms operating in knowledge-intensive services that show negative return from intra-industry externalities. Although a negative coefficient is not an ''attractive'' result, it is completely plausible since firms in this sector are characterised by a higher degree of technology and this might give rise to a higher degree of competition. In contrast, the impact is positive on the rest of the sub-samples. This may seem to contradict the fact that firms do not increase their production with their own R&D expenditures 26 ; however, the lack of ability to turn investments into innovation does not mean they cannot benefit indirectly from external knowledge. A possible explanation might be that firms use the existing external knowledge in the sector to imitate or ''copy'' what other firms do, thus acting as ''free-riders''. By doing so, they benefit from the R&D expenditures of others and increase their sales. Additionally, it might reflect the fact that firms observe the results of their competitors' investment (their successes or failures) and learn from them, using this external pool of knowledge to be more efficient in their own production.
In contrast to Beneito's (2001) findings, here it can be seen that firms operating in advanced high-tech sectors (columns 3 and 5) benefit less from the R&D expenditures made by all other firms in their sector than is the case of firms in less technologically advanced sectors (columns 2 and 4). There would appear to be, therefore, a ''technology threshold'' beyond which firms benefit less from the R&D expenditures made by all other firms in the sector. This might reflect the fact that in high-tech sectors (especially in KIS) there is a competition effect which compensates for (or even dominates) the benefits stemming from external R&D, unlike the situation that prevails in low-tech sectors.
In the breakdown by firm size there appears to be a positive coefficient only for large firms, while small and medium firms reduce their sales if the rest of the firms in the same sector increase their R&D expenditures. Thereby, the larger the firm, the greater is the benefit reaped from the R&D expenditures made by all the other firms in the same sector. A possible explanation for this might be that large firms have technological expertise and managerial skills as well as better infrastructure and higher resources which allow them to maximize the benefit from external innovations.
As for inter-industry externalities, our estimates present a high degree of heterogeneity. First, in the sample as a whole (column 1) they affect firm's sales negatively. Second, when the sample is broken down according to technology level (columns 2-5), these externalities are not significant for firms operating in low-tech manufacturing firms. This suggests that firm performance is not influenced by the innovation carried out by the rest of the sectors that serve as its suppliers. On the contrary, their effect is positive and significant in the case of high-tech manufacturing firms. This result is consistent with the ''absorption capacity'' hypothesis forwarded by Cohen and Levinthal (1989), which suggests that the degree to which a firm benefits from external innovation is strongly dependent on its own innovation expenditure. Thus, firms with greater technological capital are the ones that obtain the most benefits from externalities. Advanced firms have better infrastructure and are probably more capable of understanding and integrating external knowledge in their products and processes. In the case of the service sector, once again knowledge-intensive service presents a negative coefficient. This finding could be related to a price increase, given that suppliers may charge more after investing in R&D and, so, the firm also raises its prices. Thus, in a competitive environment, as in knowledge-intensive sectors, this might result in a reduction in sales. On the other hand, inter-industry externalities show a positive and significant coefficient for non-knowledge-intensive services, i.e. firms belonging to these sectors increase their performance thanks to the R&D expenditures of firms operating in other sectors. This result could reflect the complementarity of the technology effort between the suppliers sectors and non-knowledge-intensive services. It should be remembered that non-knowledge-intensive services present the lowest R&D stock (see Table 2), which would explain why they benefit most from the investments made by all the other firms (both in their own sector and in other sectors). Finally, in the breakdown by firm size, interindustry externalities are not relevant in general, although they present a negative coefficient for small firms.
Finally, as can be seen from Table 4, control variables are, in general, significant. The trend captures the effect of the economic crisis. Firm size has a positive impact, i.e., the larger the firm, the more productive it is. Finally, the dummy variables for technology levels show that high-tech manufacturing and non-knowledge-intensive service firms present higher sales than low-tech manufacturing firms. By contrast, knowledge-intensive services present a lower coefficient.

Further explorations
This section seeks to shed some light on the non-significant impact of R&D stock on firms' sales obtained in Table 4. In line with Crepon et al. (1998), there would appear to be a process that leads from R&D investments to innovation outputs and from there to productivity. Thus, here, as an initial attempt at adopting this new approach, innovation is defined from an output perspective. Specifically, innovation is proxied with a dummy variable that takes a value of 1 if the firm declares that it has obtained a product or process innovation during the period [t-2, t]. It is expected that firm's sales in time t increase if the firm has obtained an innovation output in the preceding three years.
As can be seen in Table 5, when adopting this new definition, innovation is clearly positive and significant in the sample as a whole and in all sub-samples. Although, as discussed above, the aim of this article is not to undertake a structural analysis, the results of this section are highly informative as they suggest that Spanish firms are able to generate a profit and increase their sales from their innovation outcomes. As such what needs to be explored in greater depth is the ability to turn R&D investment into innovations outputs. In line with the literature, advanced firms (HTMI and KIS) present a greater impact than less advanced companies. In addition, the larger the firm is, the higher the impact of innovation on firm sales. Finally, with regard to externalities, the results in Table 5 are very similar to those obtained earlier.  Capital stock (k ist ), labour (l ist ), human capital (h ist ), R&D stock (i ist ), intra-industry externality (S intra istÀ2 ), inter-industry externality (S inter istÀ2 ) Italic values refer to the number of firms and observations LTMI Low and medium-low tech manufacturing firms, HTMI medium-high and high tech manufacturing firms, NKIS non-knowledge-intensive services, KIS knowledge-intensive services *** Significant at 1 %, ** significant at 5 %, * significant at 10 %

Conclusions
This paper has studied the extent to which the level of technology of a firm and its size affect the return that firms in Spain can obtain from their own investment in R&D activities and from the R&D carried out by all other firms (both in the same sector and in other sectors). In particular, the aim of this research can be summed up in three questions: (1) Does the impact of innovation on firm performance differ according to a firm's level of technology and/ or firm size? (2) Are Spanish firms able to benefit from externalities? (3) And if so, do these benefits vary according to a firm's technology level and/or firm size?
A Cobb-Douglas production function has been employed, including not only firm own R&D investments but also intra-industry and inter-industry externalities. The empirical analysis is applied to a panel data of Spanish firms from 2004 to 2009 using the Olley and Pakes estimator to account for simultaneity and selection bias. By doing so, it is possible to obtain robust and consistent estimates allowing for firm heterogeneity, simultaneity and selection biases.
As we have seen in the descriptive analysis, significant differences were found in this regard according to the technology level of the sector in which a firm operates and according to firm size. Specifically, human capital levels present notable differences according to the sub-samples under consideration, being much greater in high-tech and small firms. Innovation effort is also clearly greater in high-tech firms (in both industrial and in service sectors) and in medium-sized firms. Therefore, in order to take these differences into account, we estimated each subsample separately.
The following conclusions can be drawn. In the first place, when the whole sample is analysed, we find that physical capital, labour, human capital and R&D stock present a positive coefficient. Externalities are also significant even though they are negative. On the other hand, the dummy variables included in the regressions to control for technology level and firm size suggest that there are, in fact, differences according to these factors.
In the second place, once we distinguish between technology level of the sector in which the firm operates and firm size, we see that the larger the firm, the more benefits it derives from physical capital investment. As far as human capital is concerned, the results show a positive impact. In particular, the larger the firm, the more benefits it obtains from hiring qualified workers and the better its performance is. Regarding R&D investment, our results suggest that R&D expenditures do not have a direct impact on firm sales. Although this result is unexpected, it is in line with the Crepon et al. (1998) approach, which holds that there is a sequential process leading from R&D to innovation outputs and from there to productivity. Therefore, the result obtained here, although somewhat surprising, provides us with valuable information in this regard. Specifically, when innovation is proxied by innovation output (as opposed to innovation input, i.e., R&D), the results clearly present positive coefficients. Therefore, with respect to the first research question, it can be concluded that the impact of innovation output differs according to the level of technology and firm size, being notably greater for those firms that operate in high-tech sectors (HTMI and KIS) and increasing with firm size.
Interestingly, the ''inability'' of firms to benefit from their own R&D efforts does not prevent them from benefiting from external knowledge. In particular, it has been seen that, in most technology levels Spanish firms increase their sales when the rest of the firms in their sector increase their R&D expenditures. Specifically, lowtech sectors manage to benefit to a greater extent from the R&D expenditure carried out by all the other firms in the same sector. This result could indicate that firms of this type seek to compensate for their smaller investment effort by taking advantage of innovation originating in firms in the same sector. It might also reflect the fact that high-tech sectors face higher competition, probably due to the higher degree of technology, which compensates for or dominates, the benefits stemming from external R&D. All in all, the results seems to point out the existence of a ''technology threshold'' beyond which firms cease to benefit from the investments in R&D carried out by all the other firms in the same sector. On the other hand, firm size reveals that only large firms increase their sales with external R&D.
Inter-industry externalities have been shown to play an ambiguous role and there would appear to be no specific pattern of behaviour associated with different levels of technology or firm size. However, the results suggest the presence of a certain complementarity for the technological efforts with supplier sectors in the case of firms belonging to high-tech manufacturing industries and non-knowledgeintensive services.
In short, and in answer to our second research question, it has been shown that Spanish firms are able to benefit from spillovers. Moreover, these benefits depend to some extent on the technology level and firm size-which results in an affirmative answer to our last question. More specifically, technology level and firm size appear to have an influence on intra-industry externalities, i.e., the less advanced and the bigger the firm, the more benefits it derives from intra-industry externalities, while their effect is much more ambiguous in the case of inter-industry externalities.
Acknowledgments This research has received funding from the European Union's Seventh Framework Programme FP7- SSH-2010SSH- -2.2-1 (2011SSH- -2014, under grant agreement n°266834. The authors are grateful for the funding obtained from the Ministry of Education and Science for the project entitled ''Determinants for the spread of innovation and their effects on productivity'', ECO2009-12678/ ECON, 2010 Goya is grateful for the support received from the CUR of the DIUE of the Generalitat de Catalunya and from the European Social Fund. Esther Vayá is grateful for the funding obtained from the Ministry of Education and Science for the project entitled ''Regional economic growth and inequality in Spain'', ECO2010-16006/ECON, 2011-2013 Suriñach is grateful for the funding obtained from the Ministry of Education and Science for the project ECO2013-41022-R. The authors are grateful for helpful comments received at the AQR Lunch Seminar celebrated on the 9th of October, 2012 at the University of Barcelona.

Appendix 1: Treatment of extreme values
The table below reports the number of firms with more than double the volume of sales by technological level. These observations have been replaced by the double of sales (see Table 6, 7).

Appendix 2: Correspondence between branches of business activity
See Table 8.   Appendix 3: Distribution of firms according subsamples See Table 9.

Appendix 4: Intermediate results
See Table 10 and 11.      Externalities are lagged two periods. Reference groups: LTMI and small firms. Bootstrapped errors in parenthesis LTMI Low and medium-low tech manufacturing firms, HTMI medium-high and high tech manufacturing firms, NKIS non-knowledge-intensive services, KIS knowledge-intensive services *** Significant at 1 %, ** significant at 5 %, * significant at 10 %. ''inv'' stands for investment in both physical capital and R&D (in logs) and it is our proxy variable    Externalities are lagged two periods. Reference groups: LTMI and small firms. Bootstrapped errors in parenthesis LTMI Low and medium-low tech manufacturing firms, HTMI medium-high and high tech manufacturing firms, NKIS non-knowledge-intensive services, KIS knowledge-intensive services *** Significant at 1 %, ** significant at 5 %, * significant at 10 %. ''inv'' stands for investment in both physical capital and R&D (in logs) and it is our proxy variable