1 Introduction

Extreme weather and changes in climate have adversely affected agricultural production and food security at the global (Burke et al. 2015; Dawson et al. 2016) and regional levels (Bozzola et al. 2018; Plastina et al. 2021; Roberts et al. 2013). In terms of milk production, the negative relationships between heat stress and milk productivity, milk quality, livestock health, and farm economy have been well documented in the literature (Blanco-Penedo et al. 2020; Dunn et al. 2014; Finger et al. 2018; Hill and Wall 2015; Njuki et al. 2020). However, the milk productivity effects of heat stress at the farm and animal-level, the effectiveness of potential adaptation strategies, and the relationship between an animal’s tolerance to heat stress and its genetic milk production potential are understudied topics, especially in the Swedish and broadly EU context.

Thus, the objectives of this study are to (i) model the relationship between milk productivity and heat stress in the context of temperate continental climate conditions such as in Swedish or Nordic conditions, (ii) assess the farm-level losses in contribution margins associated with milk losses due to heatwaves, (iii) assess the effectiveness of potential adaptation strategies such as breed diversification in the context of Swedish dairy production, and (iv) document the existence and estimate the magnitude of the trade-off between an animal’s productive capacity and heat tolerance.

To achieve these objectives, the study uses Swedish Milk and Disease Recording System (SMDRS) data from January 2016 to December 2019 coupled with meteorological data from 887 weather stations throughout Sweden and builds on the existing literature in three significant ways. First, we employ generalized additive models (GAMs), which have been previously used to understand the non-linearities in relationships between predictors and outcomes (Anglart et al. 2020; Benni et al. 2020; Hastie and Tibshirani 1990), to explore the non-linearities in the relationship between temperature, milk productivity, and bulk milk somatic cell counts (BMSCC).Footnote 1 Following Qi et al. (2015) and Njuki et al. (2020), we use temperature directly as the main independent variable, instead of an index such as temperature-humidity index (THI), since such an approach allows for a clear interpretation of temperature effects on the dependent variables. Moreover, we focus explicitly on the temperature, as the likelihood of summers with high temperatures and low rainfall have been increasing in Sweden (Wilcke et al. 2020), and it is likely that temperature may be the key climatic variable driving the decrease in milk productivity. Indeed, literature has shown that temperature alone, instead of THI, suffices to study the effects of heat stress on dairy cattle in temperate continental climates (Hut et al. 2022).

Furthermore, to complement the semi-parametric GAMs, we use cross-sectional and within-season variation (in line with Auffhammer 2018; Chen and Gong 2021; Dell et al. 2014; Kolstad and Moore 2020; Schlenker and Roberts 2009) in temperature ranges in a parametric, linear regression model to estimate the losses in production and use these estimates to calculate the reductions in farm-level contribution margins.Footnote 2 We do this exercise particularly for the year 2018 since the summer of this year was associated with long-lasting heatwaves and extended summer period, though the model can be applied to any time range in the sample period. These estimates provide insights about farm- and public policy-level strategies that can be employed to reduce the losses from heat stress. Moreover, estimates of the average loss in contribution margin due to heat stress on a Swedish dairy farm can be used to make decisions on whether a farmer should invest in risk management, given that it is costly and requires effort.

Second, we use the panel dimension of our data to assess the impact of heatwaves on different dairy breeds, thus providing knowledge on whether diversification (in terms of breeds) can be an effective portfolio management strategy to minimize the losses from heatwaves. Prior literature has advocated for such diversification in herd composition, within and across species, in other contexts (Acosta et al. 2021; Megersa et al. 2014; Rojas-Downing et al. 2017), but we found no study that provided evidence on the effectiveness of this strategy under temperate continental climatic conditions. Thus, we contribute to the literature by providing evidence on the effectiveness of diversification in breeds as a portfolio strategy to hedge against the risk of heat stress under such contexts.

Lastly, we contribute to the literature by estimating if cows with higher genetic milk production potential (i.e., a higher milk index) are more vulnerable (and less tolerant) to heat stress.Footnote 3 While the literature has provided biological explanations on why animals with high milk production potential may perform worse under heat stress (Bohlouli et al. 2021; Gauly and Ammer 2020; Zimbelman et al. 2010), we did not find any study that quantified this tradeoff for Swedish or Nordic breeds. We interact the heatwave incidence with the milk index of a cow and use the exogenous variation in heatwave incidence to causally estimate the productivity-tolerance tradeoff. Given that extreme weather events are becoming more likely at the global level (Coumou and Rahmstorf 2012), our estimates on the trade-off between animal’s milk production potential and heat tolerance have important policy implications in terms of future breeding strategies and policy regionally as well as globally.

We find that an average maximum temperature above ~ 20 ºC in the past 7 days was associated with sharp declines in milk yield in our sample. However, the increase of BMSCC is linearly associated with temperature, indicating that higher temperatures may be associated with increased risk of inflammation and udder health issues. Second, using the coefficients of temperature effects on milk production, in conjunction with distributions of number of days in a certain temperature range, herd size, and income over feed costs, we estimate the loss in contribution margin of ~ 6200 SEK for a typical Swedish dairy farm in the summer of 2018. These loss estimates are likely underestimated given that our model does not estimate the impact of heat stress on cost of feed and cow health and fertility, and only takes into account the contemporaneous milk yield loss. Given that the profit margins are slim and many dairy farms in Sweden make modest returns on investments (EDF 2014), these losses may result in farm exits, harm local dairy production, and increase Sweden’s reliance on imported dairy products.

We also find that, on average, there are no differences in the impact of heatwaves on different breeds commonly reared in Swedish dairies and that there exists a trade-off between genetic milk production potential and heat tolerance of a dairy cow. However, we find that the variance of milk losses across the genetic distribution for Swedish Red cows is less than that of Swedish Holstein cows, suggesting that cows of Swedish Red breed with higher milk potential may be less sensitive to heat stress (as compared to Swedish Holsteins). These findings have important implications in terms of adapting to heat stress, investing in mitigation measures and insurance, and developing future breeds that can ameliorate the current trade-off between genetic production capacity of a cow and its tolerance to climate events.

2 Data

Our herd- and cow-level data are drawn from Swedish Milk and Disease Recording System (SMDRS) at Växa Sverige, from January 2016 to December 2019. The database collects monthly data on herd- and cow-level milk production. This study includes a subset of 1435 dairy farms for which coordinates were also available in the database. The farms were located in all of Sweden. These farms vary greatly in their management routines. Animals remain mostly indoors during the winter months. During summer, in accordance with Swedish regulations, dairy cows are provided access to pasture and are exposed to outside temperatures during summer. However, farmers have different strategies for ensuring access to pasture. Some (mainly automatic milking system (AMS) farms) will provide free access to pasture, but the cows will be able to choose themselves. Others provide animals access to pasture after morning milking and then take them inside at night while others do the opposite and provide access during nighttime.

Meteorological data (temperature, precipitation, and humidity), recorded daily at each of the 887 weather monitoring stations located throughout Sweden, are obtained from the Swedish Meteorological and Hydrological Institute (SMHI), from January 2016 to December 2019. The maximum temperature was the highest recorded daily temperature recorded at 6 p.m. The “meteoland” package in “R” was used to interpolate the data, allowing us to generate meteorological data that are relevant for each herd. Meteorological data from a single weather station may not be representative given the spatial correlation between different weather stations that may define the weather at a certain farm. Therefore, we use the meteoland package to interpolate this meteorological data from the neighboring weather stations and rid this data of such spatial correlations using a weighted distance function approach (De Cáceres 2018; Thornton et al. 1997).

Table 1 provides descriptions of the variables used in the analysis. Table 2 provides summary statistics at the herd-level. The average milk produced per cow per day at the herd-level in our sample is 26.5 l. The average energy-corrected milk (ECM) produced, calculated as in Table 1, is 31.9 l/day. The mean for BMSCC is 225.1 thousand cells/ml. For BMSCC, geometric mean is presented due to the skewed nature of this variable. These three variables are used as independent variables in the herd-level regression analysis. The mean dairy herd size in our sample is 104.6 with a minimum of 16 and a maximum of 1155 milking cows.

Table 1 Data description
Table 2 Herd-level summary statistics

Our focus is to estimate the relationship between temperature and milk production. Therefore, we use the variable Temperature as the main predictor in our analysis. The mean maximum temperature in the last 7 days of milk recording for our sample is 10.9 ºC with 30.6 ºC being the maximum and − 17.7 ºC being the minimum, respectively. Humidity has a mean of 94.2% and Precipitation has a mean of 1.72 mm, and they are used as control variables in the statistical analysis following Qi et al. (2015) and Njuki et al. (2020).

Second, we estimate the impact of heat stress on milk productivity. Therefore, we rely on the definition of a Heatwave according to SMHI’s definition as an indicator variable = 1 if a farm experiences 5 consecutive days with maximum temperature of greater or equal to 25 ºC in the past week of the milk-recording, 0 otherwise. Overall, the likelihood of experiencing a Heatwave in our sample is only 0.02 (Table 2). However, none of the farms in the sample experience any heatwave in 2016 and 2017. On the other hand, 5.1% and 1.6% of the farms experience a Heatwave in 2018 and 2019, respectively. The mean number of Heatwaves experienced by a Swedish farm in our sample is 8.3 with a minimum of 0 and maximum of 50. However, the mean number of Heatwaves experienced by farms in 2018 is 26.3, indicating that a substantial number of Heatwaves occurred in 2018.

Table 3 provides summary statistics of the variables at the animal-level. The average milk produced by a cow in our sample is 31.5 kg/day. An average dairy cow in the sample has a Lactation Number of 2.21 and is in its 197th day of milking. Fifty-two percent, 23%, 7.5%, and 17.5% of the cows are Swedish Holstein (SH), Swedish Red (SRB), SH/SRB, and Other, respectively. The average Milk Index of a dairy cow in our sample is 0.987 with 0.495 as the minimum and 1.285 as the maximum. The average Milk Index of SH, SRB, and SH/SRB cows are 0.971, 0.987, and 0.989, respectively.Footnote 4

Table 3 Cow-level summary statistics

3 Empirical methodology

Our focus is to understand the nature (linear or otherwise) of the relationship between temperatures, milk production, and somatic cell counts in dairy production. Therefore, we employ generalized additive models (GAMs) to estimate this relationship. GAMs are flexible additive models in which smooth functions allow the relationship between a predictor and an outcome to be non-linear (Anglart et al. 2020; Benni et al. 2020; Hastie and Tibshirani 1990). This analysis not only explores the non-linearities between production and temperatures, but also gives us information on the temperatures at which the losses start to happen.

Hence, the GAM estimating equation is:

$${Milk}_{ist}={\beta }_{0}+\sum_{j=1}^{p}{f}_{j}[(Tem{p}_{ist})]+\gamma {X}_{ist}+{\mu }_{is}+{e}_{ist}$$
(1)

where \({f}_{j}(Tem{p}_{ist})\) are the non-parametric smooth functions of the potential non-linear predictor, which in this case is Temperature. The model iteratively fits polynomial basis functions to learn the underlying relationship between a predictor and an outcome from the data. However, the number of functions and spline coefficients, \({f}_{j}\), are chosen and estimated using penalized log-likelihood such that overfitting of the data is avoided (see Hastie and Tibshirani 1990).

\({Milk}_{ist}\) is (a) milk produced per cow in kilograms, (b) ECM produced per cow, or (c) bulk milk somatic cell counts at farm i, in season s, in year t. \({X}_{ist}\) contains humidity and precipitation and their squared terms to control for confounding linear and non-linear effects of these variables on Temperature. Indeed, humidity and precipitation may have direct effects on the dependent variables as well as effects through their correlation with temperatures and impact the overall intensity of heat experienced by the animal. Therefore, to isolate the effects of temperature and minimize the omitted variable bias in our models, humidity and precipitation are added as covariates in the model (as in Chen and Gong (2021); Njuki et al. (2020); Qi et al. (2015)).

\({\mu }_{is}\) are farm-by-season fixed effects that serve two important goals: First, farm fixed effects absorb any time invariant and potentially endogenous farm-level (unobserved) characteristics. Second, controlling for farm-specific seasonality is important to account for season-specific farm-level unobserved management practices that may be correlated with incidence of higher temperatures.Footnote 5 The smoothing parameter was estimated using the restricted maximum likelihood, REML, method for all GAMs. These farm-level GAMs are estimated for Milk per Cow, ECM per Cow, and BMSCC, respectively.

The study also aims to quantify the financial losses due to decrease in milk productivity associated with heat stress. We employ a temperature bin approach to obtain a more interpretable measure of the productivity-temperature relationship, which will help us in converting milk productivity losses associated with heat stress into losses in contribution margins. In the temperature bin approach, the temperature range is divided into equal temperature bins such that the linear regression fits a separate productivity-temperature coefficient for each temperature bin. In this manner, the non-linearities of productivity-temperature relationship can be examined, as well as the coefficients are more interpretable (as growth or loss rates) than other approaches like GAMs. Such an empirical strategy is widely applied in environmental and agricultural economics literature (Auffhammer 2018; Chen and Gong 2021; Dell et al. 2014; Kolstad and Moore 2020; Schlenker and Roberts 2009). The estimating equation is

$${Milk}_{ist}={\beta }_{0}+{\beta }_{m}{\sum }_{m}Tbi{n}_{ist}^{m}+\gamma {X}_{ist}+{\mu }_{is}+{e}_{ist}$$
(2)

where \({Milk}_{ist}\) is milk produced per cow in kilograms on farm i, in season s, and year t. \(Tbi{n}_{ist}^{m}\) is the heat accumulation at farm i, in season s, and year t, when maximum temperature is in the mth temperature bound 2 days before the milk recording day (as in Blanco-Penedo et al. 2020). We chose a 5 ºC temperature bin for the analysis. Specifically, the temperature range is divided into ten temperature bins, each of which was 5 ºC wide. We define \(Tbi{n}_{ist}^{1}=\) heat accumulation when temperature was in the range of [− 20 ºC, − 15 ºC), \(Tbi{n}_{ist}^{2}=\) heat accumulation when temperature was in the range [− 15 ºC, − 10 ºC), and so on. The parameter \({\beta }_{m}\) provides the productivity-temperature loss rates for the \({m}^{th}\) temperature bin.

\({X}_{ist}\) contains humidity and precipitation and their squared terms to control for confounding linear and non-linear effects of these variables on temperatures. \({\mu }_{is}\) are farm-by-season fixed effects that absorb any time invariant and potentially endogenous farm-level (unobserved) characteristics and control for farm-specific seasonality in management practices that may be correlated with temperature. \({e}_{ist}\) is the error term. The parameter \({\beta }_{1}\) causally estimates the impact of a certain temperature range on milk production (given the assumption that variation in temperature over time is exogenous and randomly distributed conditional on farm location). Following Barrot and Sauvagnat (2016), standard errors are clustered at the farm-level to account for the serial correlation of the error term within farms.

The estimates from Eq. (2) allow us to simulate losses in contribution margins experienced as a result of high-temperature days. Specifically, the loss in contribution margin for the 2018 summer season can be simulated via Eq. (3) and associated parameters:

$$Los{s}_{it}={\sum }_{m}{\beta }_{m}\times No. \;of\; Day{s}_{it}\times IOFC\times Herd\; Siz{e}_{i}$$
(3)

where \(Los{s}_{it}\) is the average loss in contribution margin experienced by farm i in year t due to decreased milk production. The parameter \({\beta }_{m}\) is estimated by Eq. (2) and represents the loss in milk production in a certain temperature range m. This parameter is multiplied by the distributions of number of days in temperature bin m, income over feed costs (IOFC), and milking herd size. The distribution for the number of days and herd size is obtained from the meteorological data and herd data, respectively, while the distribution for IOFC is obtained from Månsson and Skyggeson (2017). These data and parameters are exported to Microsoft Excel, and Monte Carlo simulations (with replacement) are performed using the @Risk add-in in Microsoft Excel. Table 8 in the Appendix provides information about the distributions of these variables.

After estimating financial losses due to heat stress, we turn our attention to a potential adaptation measure, i.e., diversification in terms of breeds. We use animal-level data to estimate the effect of heatwaves on different breeds within Swedish dairy production. Equation (4) provides an empirical test for whether diversification in terms of breeds can ameliorate the losses due to heatwaves:

$${Milk}_{ijst}={\alpha }_{0}+\varphi Heatwav{e}_{jst}+\sum_{m=1}^{M}{\alpha }_{m}Bree{d}_{mi}+\sum_{m =1}^{M}{\delta }_{m}Bree{d}_{mi}\times Heatwav{e}_{jst} +\rho {X}_{ijst}+{\theta }_{js}+{e}_{ijst}$$
(4)

where \({Milk}_{ijst}\) is (a) milk produced per cow, (b) ECM produced per cow, and (c) fat or protein percentage of the milk produced by cow i, in farm j, in season s, and year t.Footnote 6 The variable \(Heatwav{e}_{jst}\) is defined as an indicator variable = 1 if farm j experiences 5 consecutive days with maximum temperature of ≥ 25 ºC in the past week of the milk recording, 0 otherwise. \(Bree{d}_{mi}\) are a vector of dummy variables that indicate cow i’s breed, indexed by m (representing SH, SRB, SH/SRB, with Other breeds as the base). \({\alpha }_{m}\) are a vector of coefficients that absorb the effect of a cow’s breed on milk production. The interaction term \(Bree{d}_{mi}\times Heatwav{e}_{jst}\) captures the interaction effects between a cow’s breed and heatwaves. Thus, \({\delta }_{m}\) is a vector of coefficients that captures, on average, the differential effects of heatwaves across cow breeds. Any \({\delta }_{m}\ne 0\) would provide evidence of differences in the average effects of heatwaves across cow breeds and thus would provide evidence of whether diversification in breeds can work as an adaptation strategy in the Swedish context.

\({X}_{ijst}\) are farm-level (humidity, precipitation, and their squared terms) and cow-level (days in milk and lactation number) control variables. \({\theta }_{js}\) are farm-by-season fixed effects that control for farm-level time-invariant heterogeneity as well as farm-specific seasonality in management practices and milk production.

Lastly, we estimate the effect of Milk Index of a cow (which, in this study, is the genetic milk production potential of a cow determined at birth by the parental milk index averages) on milk production under a heatwave. Equation (5) provides an empirical test for whether there is a trade-off between genetic milk production potential of a cow and its ability to blunt heat shocks.

$${Milk}_{ijst}=\beta +\mu Heatwav{e}_{jst}+\varphi MilkInde{x}_{i}+\gamma MilkInde{x}_{j}\times Heatwav{e}_{jst} +\tau {X}_{ijst}+{\theta }_{js}+{e}_{ijst}$$
(5)

where \({Milk}_{ijst}\) is milk produced in kilograms by cow i, in farm j, in season s, and year t. \(MilkInde{x}_{i}\) is the genetic milk production potential of cow i. The coefficient on the interaction term, \(MilkInde{x}_{j}*Heatwav{e}_{jst}\), determines whether there is a trade-off between genetic potential and heat tolerance. \(\gamma <0\) would indicate that as the genetic milk production potential of a cow increases, its performance under a heatwave goes down. \({X}_{ijst}\) are farm-level (humidity, precipitation, and their squared terms) and cow-level (days in milk and lactation number) control variables. \({\theta }_{js}\) are farm by season fixed effects as in above regressions.

Similar regressions are estimated separately for SH, SRB, and SH/SRB breeds to examine if different breeds have different impacts on milk production as their genetic milk production potential increases. This analysis will provide evidence on whether there are any breed-level differential effects on the trade-off between genetic milk production potential and animal’s tolerance to heat stress. These regressions are essentially difference-in-difference regressions with a continuous treatment (e.g., Acemoglu et al. 2004). Standard errors for all regression specifications are clustered at the farm-level to account for the serial correlation of the error term within farms.

4 Results and Discussion

4.1 Relationship between milk production and temperature

Figures 1, 2, and 3 illustrate the results from GAMs, Eq. (1), with Milk per Cow, ECM per Cow, and BMSCC as dependent variables, respectively. We observe that the Milk per Cow and ECM per Cow, reflecting milk yield and energy-adjusted milk yield measures, respectively, start declining around the 10 ºC. However, the productivity sharply declines after the average maximum temperature of the past week crosses 22–23 ºC (Figs. 1 and 2).Footnote 7BMSCC is linearly and positively related to the maximum temperature of the past week (Fig. 3), suggesting that increased BMSCC associated with increased temperatures may be one of the important mechanisms that negatively affect milk yield and quality. These results also corroborate other studies in different regions that find negative relationships between heat stress, milk yield, and animal health (Finger et al. 2018; Njuki et al. 2020; Polsky and von Keyserlingk 2017; Qi et al. 2015). These findings suggest that the average rise in summer temperatures due to long-term climate change poses a significant risk to profitable and efficient milk production in Sweden (and more broadly to other countries, which perhaps experience more severe heatwaves).Footnote 8

Fig. 1
figure 1

Relationship between milk per cow and temperature estimated via GAMs. The blue line indicates the estimated partial effect of temperature on milk per cow, and the shaded region indicates standard errors

Fig. 2
figure 2

Relationship between ECM per Cow and temperature estimated via GAMs. The blue line indicates the estimated partial effect of temperature on ECM per cow, and the shaded region indicates standard errors

Fig. 3
figure 3

Relationship between BMSCC and temperature estimated via GAMs. The blue line indicates the estimated partial effect of temperature on BMSCC, and the shaded region indicates standard errors

While GAMs are useful in predicting and understanding the non-linear relationships between predictors and outcomes, they may lack interpretability.Footnote 9 To obtain interpretable coefficients of the productivity-temperature relationship and to use these coefficients in estimation of losses in contribution margins due to increased heat stress, we rely on the temperature bin approach (Chen and Gong 2021; Schlenker and Roberts 2009). In addition, weekly averages of maximum temperature may not capture some hot days that occurred between cold ones and can distort our estimation of losses. Therefore, to capture the effect of individual days, we rely on the effect of temperatures 2 days before the day of milk recording date (as in Blanco-Penedo et al. 2020).

Figure 4 shows the estimates of the effect of (2-day lagged) temperature bins on Milk per Cow, from Eq. (2). We observe that the losses in milk productivity start happening from around 15 ºC bins and the size of this loss considerably increases after the 20 ºC mark, similar to the results obtained in Fig. 1. The coefficients associated with these temperature bins are provided in Table 7.Footnote 10 Each day in the temperature range of 20–25 ºC is associated with an average loss of about 0.2 kg/day/cow, statistically significant at 1% level of significance, while each day in the temperature range of 25–30 ºC is associated with an average loss of about 0.54 kg/day/cow, statistically significant at 1% level of significance. These results not only illustrate the convex relationship between productivity and temperature (which was previously shown through Fig. 1), but also allow us to interpret the loss-rates within different temperature ranges.

Fig. 4
figure 4

Relationship between changes in milk production per cow and temperature bins (5 ºC intervals)

We can now plug the estimates from Eq. (2) into Eq. (3) to estimate farm-level losses in contribution margins due to the high temperatures of 2018. The fitted distributions for Herd Size and No. of Days are shown in Table 8. In addition, the distributions of \({\beta }_{m}\), IOFC, Herd Size, and No. of Heatwaves are also provided in Table 8. Equation (3), therefore, simulates the average loss of contribution margin on a typical Swedish farm and finds that the summer of 2018 resulted in an average loss of 6,258 (SD = 4,330) SEK in contribution margins.Footnote 11 This estimate is based on the average herd size, but given the large variation in herd sizes across Sweden, we expect a high variance in the impact of heat stress across farms as shown by the large standard deviation. Losses in contribution margins across farms for the year 2018 are shown in Fig. 5.

Fig. 5
figure 5

Losses in contribution margins across Swedish dairy farms in 2018

This loss in contribution margin is likely a lower bound of actual losses due to a few important reasons. First, while we model the increase in BMSCC to show increased health risk due to increase in temperature, our estimations of financial loss only consider milk losses. Increased costs due to potential loss in fertility and increased cases of mastitis (and other disorders) may be associated with heat stress and can be important contributors to reduction in contribution margins (Polsky and von Keyserlingk 2017). Second, adverse impacts of heat stress on udder health can have long-term consequences to milk productivity, which are not captured by our loss parameter.Footnote 12 Third, heatwaves may negatively affect pastures and costs of feed available to dairy farms. This may reduce the income over feed costs for farmers and result in lower contribution margins. This dimension of loss is also not included in our model.

These losses associated with heat stress can have adverse impacts on the Swedish and more broadly Nordic dairy industry. EDF (2014) shows that many Swedish and EU dairy farms are working on slim profit margins. The recent increase in the risk of heat stress and consequent losses in contribution margins can severely affect the economic viability of these farms if appropriate adaptation measures are not adopted.

4.2 Diversification in breeds

Diversification in herd composition can be a useful strategy to blunt climate shocks (Rojas et al. 2017). Table 4 provides results from Eq. (4), which tests the differential impacts of heatwaves on the milk/ECM production, fat content, and protein content of different dairy breeds in Sweden. On average, the milk production of SH, SRB, and their crosses, which are the predominant breeds used in Swedish dairy production, reacts similarly under heatwaves. These results show that, on average, none of the predominant breeds have any significant advantage in terms of ameliorating heat shocks. These results contribute to the evidence on the effectiveness (or lack of effectiveness) of diversification in breeds as a portfolio strategy to hedge against the risk of heat stress under temperate continental climatic conditions such as in the Swedish or Nordic dairy production context.

Table 4 The effect of heatwaves on Swedish dairy breeds – animal-level regressions

We also want to estimate if the SH and SRB animals of higher milk production potential are equally vulnerable to heat shocks. While the average effects for both breeds may be similar (as in Table 4), some breeds may have smaller variation within their cohorts, providing suggestive evidence that further development and use of these breeds may increase heat tolerance.

4.3 Productivity-tolerance trade-off

Table 5 provides estimates of the trade-off between genetic milk production potential and tolerance of a cow when faced with a weather shock. We find that the impact of a heatwave on Milk per Cow for an animal with an average Milk Index is − 0.926 kg \(\left(1.67-\left(2.63\times 0.987\right)\right)\) (column 1, Table (5). However, a 10% increase in the average Milk Index of a cow leads to a loss of − 1.18 kg \(\left(1.67-\left(2.63\times 1.086\right)\right)\), constituting a 27.4% \(\left(\frac{\left(1.18-0.926\right)}{0.926}\times 100\right)\) increase in the impact of a heatwave on milk loss.

Table 5 Effect of heatwaves on cows with differing milk production potential

Table 5, columns 2, 3, and 4, estimate the trade-off between genetic milk production potential and heat tolerance of SH, SRB, and SH/SRB cows, separately, under a heatwave. This analysis provides information regarding the within-breed tolerance of higher milk potential animals, when faced with heat stress. We find that the impact of a heatwave on Milk per Cow for SH cows with an average Milk Index is − 0.840 kg \(\left(2.28-\left(3.21\times 0.971\right)\right)\) (column 2, Table (5). However, a 10% increase in the average Milk Index of an SH cow leads to a loss of − 1.14 kg \(\left(2.28-\left(3.21\times 1.068\right)\right)\), thus a 35.7% \(\left(\frac{\left(1.14-0.840\right)}{0.840}\times 100\right)\) increase in the impact of a heatwave on milk loss.

For SRB cows, the impact of a heatwave on Milk per Cow with an average Milk Index is − 0.934 kg \(\left(0.25-\left(1.20\times 0.987\right)\right)\) (column 3, Table 5). However, a 10% increase in the average Milk Index of a SRB cow leads to a loss of − 1.053 kg \(\left(0.25-\left(1.20\times 1.086\right)\right)\), constituting a 12.7% \(\left(\frac{\left(1.053-0.934\right)}{0.934}\times 100\right)\) increase in the impact of a heatwave on milk loss. Similarly, column 4 shows the impact of a heatwave on Milk per Cow for SH/SRB crossbred cows. For SRB/SH crossbred cows with an average Milk Index, the impact of a heatwave is − 1.07 kg \(\left(2.15-\left(3.26\times 0.989\right)\right)\). However, a 10% increase in the average Milk Index of a SH/SRB cow leads to a loss of − 1.40 kg \(\left(2.15-\left(3.26\times 1.088\right)\right)\), representing a 30.8% \(\left(\frac{\left(1.40-1.07\right)}{1.07}\times 100\right)\) increase in the impact of a heatwave on milk loss. In our case, the heat tolerance of crossbred animals is between SH and SRB purebreds. However, in some cases and for some traits, crossbred cows can outperform purebreds due to crossbreeding vigor (Ferris et al. 2018).Footnote 13

Overall, Table 5 shows that there is indeed a trade-off between the genetic milk production potential and heat tolerance of dairy cattle in the face of heat stress. Furthermore, while the negative relationship between production potential and heat tolerance exists for all breeds, the magnitude of this trade-off may be heterogenous across breeds. Following Clogg et al. (1995), a Wald test is conducted to test for statistical differences among the interaction terms (\(Heatwave\times MilkIndex\)) in columns 2, 3, and 4 of Table 5. We find that the interaction terms in columns 2 and 3 are statistically different at 1% level of statistical significance. This implies that the SRB cows of higher milk genetic merit seem to provide a partial buffer against the negative effects of heat stress when compared to SH cows. However, the overall negative relationship between heat stress and milk production, especially for higher milk genetic merit animals of all breeds, highlights the need to re-orient future breeding goals as selecting just for high milk yield may not remain optimal under increased threat of heat stress and climate change.

While our results highlight the importance of heat tolerance to ameliorate the losses from heat stress, we acknowledge that this is just one dimension in which our dairy animals need to improve in face of changing environmental circumstances. Future research and breeding should take a more holistic approach and broadly aim to enhance the overall resilience of animals by considering their heat tolerance, fertility, disease resistance, and longevity, which are all important genetic and economic indicators for dairy animals. To ensure a profitable and efficient global dairy production, breeding animals that are resilient in several of the above-mentioned ways seems to be the only promising long-term solution to the emerging environmental challenges.

5 Conclusion

Increase in the occurrence of prolonged summers and heat stress due to long-term climate change presents a threat to efficient and profitable dairy production globally as well as in the Nordic countries. This study models the relationship between temperature and production in the Swedish dairy sector and finds that the past 7-day average of maximum temperatures above ~ 20 ºC is associated with sharp declines in milk productivity. These declines in milk productivity are associated with farm-level losses in contribution margins, thus hurting the financial wellbeing of dairy farmers. These results highlight the need for adoption of farm-level adaptation measures even at relatively moderate summer temperatures (~ 20 ºC).

The study also estimates the impact of heatwaves on different dairy breeds and on high milk production potential animals of different breeds to understand the role of breed diversification as a portfolio management strategy and heat tolerance of high milk production potential animals of different breeds, respectively. We find that, on average, there are no differences in the negative impact of heatwaves on milk losses of different dairy breeds. However, there exists a trade-off between genetic milk production potential and heat tolerance of a dairy cow.

The negative relationship between heat stress and milk productivity, especially for cows with higher milk genetic merit, underscores the pitfalls of selecting breeds only for milk yield as the world increasingly experiences weather anomalies and emphasizes the need to re-evaluate breeding goals in Sweden as well as globally. Identification of heat-tolerant breeds can be used to minimize the impact of heat stress on dairy productivity and manage climate risk in the short term. However, future research should aim to enhance other important traits like fertility, disease resistance, longevity in conjunction with milk yield, and heat tolerance to produce truly resilient animals and ensure a robust dairy sector under climate change.