## Abstract

This study aims to identify the effects of temperature on dairy production and the heat tolerance of different dairy breeds under heat stress. Using farm and animal-level data from 1435 dairy farms throughout Sweden for 4 years (from 2016 to 2019), we find that a 7-day average of daily maximum temperatures above ~ 20 ºC is associated with sharp declines in milk production. We then estimate the farm-level loss in contribution margin for a typical Swedish dairy farm for the year 2018, which consisted of long-lasting heatwaves and extended summer temperatures. We also estimate that, on average, there are no differences in the impact of heatwaves on milk losses for different dairy breeds but that there exists a trade-off between genetic milk production potential and heat tolerance of a dairy cow. The magnitude of this productivity-tolerance trade-off may differ across breeds, suggesting that the high-production potential animals of certain breeds may be less sensitive to heat stress. These findings have important implications in terms of adapting to heat stress, investing in mitigation measures, and development of future breeds that can ameliorate the current trade-off between production capacity of a cow and its heat tolerance.

## 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.

## 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.

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}

## 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:

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

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:

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:

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.

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.

## Results and Discussion

### 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 7}*BMSCC* 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}

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.

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.

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.

### 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.

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.

### 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, 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.

## 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.

## Data availability

Data are available from the corresponding author upon request.

## Code availability

Codes are available from the corresponding author upon request.

## Change history

### 18 December 2022

The article's disposition of figures was corrected to match the text.

## Notes

BMSCC are counts of the white blood cells in milk that, at higher levels, are associated with increased inflammation and reduced udder health.

In our study, seasons are defined as December to February (Winter), March to May (Spring), June to August (Summer), and September to November (Autumn).

The milk index, in this study, is the genetic milk production potential of a cow determined at birth by the parental milk index averages and can be thought of as a production capacity marker for an individual cow.

*Milk Index*is sometimes multiplied by 100. In our case, that would mean that the average*Milk Index*of a dairy cow in our sample is 98.7 with 49.5 as the minimum and 128.5 as the maximum. The average*Milk Index*of SH, SRB and SH/SRB cows is 97.1, 98.7, and 98.9, respectively.Fisher et al. (2012) argue that two-way fixed effects can absorb all the variation in weather and may lead to statistically insignificant weather effects. However, this has not been the case in our example.

Because these are individual animal regressions, we do not include a bulk milk somatic cell count regression as we did for farm-level regressions.

Most of the literature uses a temperature-humidity index (THI) to model heat stress effects on dairy cattle. Figure 6 shows the relationship between milk production and THI for our sample.

Table 6 shows the relationship between physiological outcomes and humidity and precipitation and their squared terms. We observe that in our sample, humidity has an overall positive effect on milk productivity, but the marginal effect diminishes at higher values of humidity (negative coefficient on the squared term). Precipitation has a negative impact on milk productivity; however, the negative impact diminishes at an increasing rate (positive coefficient on the squared term). It is worth noting that these variables are added in the model in Eq. (1) to control for their confounding effect on temperature, and their own impact is not the focus of the paper. Future research should delve deeper into the non-linearities associated with these climatic variables to precisely understand the relationship between these variables and physiological outcomes. Furthermore, these variables are added in the model in a linear, parametric way and not as smooth functions to avoid the problem of concurvity, which can occur if more than one variable is added as smooth functions in the GAMs (Ramsay et al. 2003).

With GAMs, we do not know the exact function form of the resultant spline function used in the analysis. However, this class of models learns from the underlying data and iteratively picks several functions (polynomials, wavelets) to fit the data, and the resultant functional form is a weighted average of these functions.

The results remain unchained even if we change the size of the bins as shown in Fig. 7 of the Appendix.

Plugging values in Eq. (3), \(\left(0.196\times 57.4\times 1.55\times 104.6\right)+\left(0.532\times 51.2\times 1.55\times 104.6\right) = 6258\) SEK.

Please refer to Polsky and von Keyserlingk (2017) for a detailed discussion on the effects of heat stress on dairy cow health and reproduction.

Crossbreeding vigor refers to the phenomenon that progeny of diverse varieties of species or crosses between species may exhibit greater desirable traits like fertility, heat tolerance, and speed of development than both parents. Though that is not the case for crossbred SH/SRB cattle in terms of tolerance to heat stress.

## References

Acemoglu D, Autor DH, Lyle D (2004) Women, war, and wages: the effect of female labor supply on the wage structure at midcentury. J Political Econ 112(3):497–551

Acosta A, Nicolli F, Karfakis P (2021) Coping with climate shocks: the complex role of livestock portfolios. World Dev 146:105546

Anglart D, Hallén-Sandgren C, Emanuelson U, Rönnegård L (2020) Comparison of methods for predicting cow composite somatic cell counts. J Dairy Sci 103(9):8433–8442

Auffhammer M (2018) Quantifying economic damages from climate change. J Econ Perspect 32(4):33–52

Barrot JN, Sauvagnat J (2016) Input specificity and the propagation of idiosyncratic shocks in production networks. Q J Econ 131(3):1543–1592

Benni S, Pastell M, Bonora F, Tassinari P, Torreggiani D (2020) A generalised additive model to characterise dairy cows’ responses to heat stress. Animal 14(2):418–424

Blanco-Penedo I, Velarde A, Kipling RP, Ruete A (2020) Modeling heat stress under organic dairy farming conditions in warm temperate climates within the Mediterranean basin. Clim Change 162(3):1269–1285

Bohlouli M, Yin T, Hammami H, Gengler N, König S (2021) Climate sensitivity of milk production traits and milk fatty acids in genotyped Holstein dairy cows. J Dairy Sci

Bozzola M, Massetti E, Mendelsohn R, Capitanio F (2018) A Ricardian analysis of the impact of climate change on Italian agriculture. Eur Rev Agric Econ 45(1):57–79

Burke M, Hsiang SM, Miguel E (2015) Global non-linear effect of temperature on economic production. Nature 527:235–239. https://doi.org/10.1038/nature15725

Coumou D, Rahmstorf S (2012) A decade of weather extremes. Nat Clim Change 2(7):491–496

Chen S, Gong B (2021) Response and adaptation of agriculture to climate change: Evidence from China. J Dev Econ 148:102557

Clogg CC, Petkova E, Haritou A (1995) Statistical methods for comparing regression coefficients between models. Am J Sociol 100(5):1261–1293

Dawson TP, Perryman AH, Osborne TM (2016) Modelling impacts of climate change on global food security. Clim Change 134:429–440

De Cáceres M (2018) User’s guide to meteoland (ver. 0.7. 1)

Dell M, Jones BF, Olken BA (2014) What do we learn from the weather? The new climate-economy literature. J Econ Lit 52(3):740–798

Dunn RJ, Mead NE, Willett KM, Parker DE (2014) Analysis of heat stress in UK dairy cattle and impact on milk yields. Environ Res Lett 9(6):064006

EDF (2014) How successful are European dairy farms? EuroTier Dairy Event, Germany

Ferris CP, Purcell PJ, Gordon AW, Larsen T, Vestergaard M (2018) Performance of Holstein and Swedish-Red× Jersey/Holstein crossbred dairy cows within low-and medium-concentrate grassland-based systems. J Dairy Sci 101(8):7258–7273

Finger R, Dalhaus T, Allendorf J, Hirsch S (2018) Determinants of downside risk exposure of dairy farms. Eur Rev Agric Econ 45(4):641–674

Fisher AC, Hanemann WM, Roberts MJ, Schlenker W (2012) The economic impacts of climate change: evidence from agricultural output and random fluctuations in weather: comment. Am Econ Rev 102(7):3749–3760

Gauly M, Ammer S (2020) Challenges for dairy cow production systems arising from climate changes. Animal 14(S1):s196–s203

Hastie TJ, Tibshirani RJ (1990) Generalized additive models (Vol. 43). CRC press

Hill DL, Wall E (2015) Dairy cattle in a temperate climate: the effects of weather on milk yield and composition depend on management. Animal 9(1):138–149

Hut PR, Scheurwater J, Nielen M, van den Broek J, Hostens MM (2022) Heat stress in a temperate climate leads to adapted sensor-based behavioral patterns of dairy cows. J Dairy Sci

Kolstad CD, Moore FC (2020) Estimating the economic impacts of climate change using weather observations. Rev Environ Econ Policy 14(1):1–24

Månsson A, Skyggeson P (2017) Mjölkavkastningens betydelse för lönsamheten hos mjölkföretagare. https://stud.epsilon.slu.se/11891/

Megersa B, Markemann A, Angassa A, Ogutu JO, Piepho HP, Zárate AV (2014) Livestock diversification: an adaptive strategy to climate and rangeland ecosystem changes in southern Ethiopia. Hum Ecol 42(4):509–520

Njuki E, Bravo-Ureta BE, Cabrera VE (2020) Climatic effects and total factor productivity: econometric evidence for Wisconsin dairy farms. Eur Rev Agric Econ 47(3):1276–1301

Plastina A, Lence SH, Ortiz‐Bobea A (2021) How weather affects the decomposition of total factor productivity in U.S. agriculture. Agric Econ 1–20. https://doi.org/10.1111/agec.12615

Polsky L, von Keyserlingk MA (2017) Invited review: effects of heat stress on dairy cattle welfare. J Dairy Sci 100(11):8645–8657

Qi L, Bravo-Ureta BE, Cabrera VE (2015) From cold to hot: climatic effects and productivity in Wisconsin dairy farms. J Dairy Sci 98(12):8664–8677

Ramsay TO, Burnett RT, Krewski D (2003) The effect of concurvity in generalized additive models linking mortality to ambient particulate matter. Epidemiology 14(1):18–23

Roberts MJ, Schlenker W, Eyer J (2013) Agronomic weather measures in econometric models of crop yield with implications for climate change. Am J Agric Econ 95(2):236–243

Rojas-Downing MM, Nejadhashemi AP, Harrigan T, Woznicki SA (2017) Climate change and livestock: impacts, adaptation, and mitigation. Clim Risk Manag 16:145–163

Schlenker W, Roberts MJ (2009) Nonlinear temperature effects indicate severe damages to US crop yields under climate change. Proc Natl Acad Sci 106(37):15594–15598

Thornton PE, Running SW, White MA (1997) Generating surfaces of daily meteorological variables over large regions of complex terrain. J Hydrol 190(3–4):214–251

Wilcke RAI, Kjellström E, Lin C, Matei D, Moberg A, Tyrlis E (2020) The extremely warm summer of 2018 in Sweden–set in a historical context. Earth Syst Dyn 11(4):1107–1121

Zimbelman RB, Baumgard LH, Collier RJ (2010) Effects of encapsulated niacin on evaporative heat loss and body temperature in moderately heat-stressed lactating Holstein cows. J Dairy Sci 93:2387–2394

## Funding

Open access funding provided by Swedish University of Agricultural Sciences. This research was funded by FORMAS grant no. 2018–02815.

## Author information

### Authors and Affiliations

### Contributions

HA: funding acquisition; manuscript writing; data analysis. LMT: manuscript writing; data analysis. UE: funding acquisition; manuscript writing.

### Corresponding author

## Ethics declarations

### Ethical approval

The study did not require ethical approval.

### Consent for publication

You have our permission to publish the work after due process.

### Consent to participate

The study uses production data from dairy farms in Sweden which is collected after informed consent of the farmer.

### Competing interests

The authors declare no competing interests.

## Additional information

### Publisher's note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Appendix

### Appendix

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

Ahmed, H., Tamminen, LM. & Emanuelson, U. Temperature, productivity, and heat tolerance: Evidence from Swedish dairy production.
*Climatic Change* **175**, 10 (2022). https://doi.org/10.1007/s10584-022-03461-5

Received:

Accepted:

Published:

DOI: https://doi.org/10.1007/s10584-022-03461-5

### Keywords

- Climate change
- Heat tolerance
- Milk productivity
- Climate adaptation
- Heat stress