Adaptation mitigates the negative effect of temperature shocks on household consumption

Consumption plays an important role in economic growth, but little is known about its response to weather extremes. This paper examines the effect of temperature shocks on consumption using high-frequency and fine-scale data from the world’s largest payment network. Our analysis shows that excessive heat and cold have a direct and immediate negative effect on various consumption activities in the short run, leading to an inverted U-shaped relationship between temperature and consumption. Consumption sensitivity varies by climate region, with cold regions being more sensitive to excessive heat. The long-run projections show that without adaptation, climate change would reduce aggregate consumption under both moderate and aggressive scenarios by the end of the century. However, no evidence of consumption reduction arises once adaptation is accounted for. The findings highlight the importance of incorporating the moderating role of adaptation in understanding consumption responses to climate change. Using detailed data on credit and debit card transactions, Lai et al. show an inverted U-shaped relationship between temperature and consumption in the short run. Adaptation moderates the relationship in the long run.

temperature relationship flexibly, we specify a model with a series of 5 °F bins based on the ten-day average temperature to capture the short-term displacement of consumption (for example, moving consumption from one day to the next). The regression model includes weather conditions (for example, precipitation and humidity), air pollution, and a rich set of spatial and temporal fixed effects to control for baseline differences in consumption across cities and over time. The remaining variation in temperature is unlikely to be correlated with unobserved economic and environmental factors that affect consumption. To further support causality, we estimate the impacts of future temperature on current consumption as a falsification test. Additionally, we examine the impacts of temperature on consumption subcategories, explore nonlinear impacts across multiple days and estimate heterogeneous impacts in different climate regions.
To understand the consumption impact of climate change in the long run, we take adaptation into account by allowing the consumption-temperature relationship to be affected by climate conditions. We use linear splines to characterize the regional heterogeneity in the consumption-temperature relationship as a function of local climate conditions (equation (2)). Our method follows the strategy in refs. 26,35 , which study the impacts of climate change on energy demand and mortality, respectively. In addition, we allow economic growth (gross domestic product (GDP) per capita) to affect the consumption-temperature relationship following ref. 36 . We project consumption changes induced by temperature shocks under different climate scenarios by allowing the consumption-temperature relationship to evolve on the basis of projected climate conditions, hence incorporating potential adaptation to future climate. Intuitively, if Beijing's future climate becomes similar to Shanghai's current climate, Beijing's consumption-temperature relationship in the future is assumed to be the same as Shanghai's current consumption-temperature relationship in the long-run projections.
Our analysis provides four key findings. First, excessive heat and cold have a direct and immediate negative effect on household consumption, after accounting for interday substitution. The inverted Adaptation mitigates the negative effect of temperature shocks on household consumption Wangyang Lai 1 ✉ , Shanjun Li 2 ✉ , Yanyan Liu 3 ✉ and Panle Jia Barwick 4 ✉ Consumption plays an important role in economic growth, but little is known about its response to weather extremes. This paper examines the effect of temperature shocks on consumption using high-frequency and fine-scale data from the world's largest payment network. Our analysis shows that excessive heat and cold have a direct and immediate negative effect on various consumption activities in the short run, leading to an inverted U-shaped relationship between temperature and consumption. Consumption sensitivity varies by climate region, with cold regions being more sensitive to excessive heat. The long-run projections show that without adaptation, climate change would reduce aggregate consumption under both moderate and aggressive scenarios by the end of the century. However, no evidence of consumption reduction arises once adaptation is accounted for. The findings highlight the importance of incorporating the moderating role of adaptation in understanding consumption responses to climate change.

NaTUrE HUmaN BEHaviOUr
U-shaped relationship between temperature and consumption is robust to a range of model specifications. Second, the sensitivity of consumption responses to temperature shocks differs across climate regions, with cold regions being more sensitive to excessive heat and warm regions being more sensitive to excessive cold. The heterogeneity in the consumption-temperature relationship probably reflects the role of adaptation. Third, without adaptation, our long-run projections show that end-of-century (2080-2099) consumption would observe a statistically significant and economically important decrease of 0.37% (P = 0.005; 95% confidence interval (CI), −0.61% to −0.09%, or ¥148 billion) under the moderate Representative Concentration Pathway (RCP4.5) scenario, and a decrease of 0.86% (P = 0.003; 95% CI, −1.39% to −0.27%, or ¥344 billion) under the aggressive RCP8.5 scenario on an annual basis. Fourth, when both the heterogeneity in consumption sensitivity to temperature and the changing nature of this relationship due to adaptation are incorporated, the estimated consumption change due to climate change is closer to zero and not statistically significant.
The long-run effect of climate change incorporates both the direct impact of temperature and the moderating effect of adaptation. First, the temperature impact indicates that both excessive heat and cold reduce household consumption. As climate warms, the temperature distribution shifts to the right, implying fewer cold days and more hot days. The net impact depends on the change of the distribution and the slopes of the consumption-temperature relationship at both ends of the temperature distribution, and hence is ambiguous a priori. Our finding of a negative consumption effect under both climate scenarios in the absence of adaptation implies that the reduction in consumption due to more hot days outweighs the increase in consumption due to fewer cold days under both climate scenarios. Second, climate adaptation implies that the slope of the consumption-temperature relationship changes: cities are better able to cope with hot weather but less able to cope with cold weather as the climate warms up. That is, there is adaption towards hot weather but de-adaption towards cold weather. Adaptation would therefore dampen the impact of excessive heat but intensify the impact of excessive cold. The net impact from adaption is ambiguous a priori. Our finding that the consumption effect becomes smaller and statistically insignificant after accounting for adaptive behaviour implies that adaptation dominates de-adaptation in the aggregate.

results
Main result. Figure 1 and Supplementary Table 3 report the effects of average daily temperature on consumption during a ten-day period (the current day and the next nine days), relative to the reference temperature bin (40-45 °F) from estimating equation (1). The result shows an inverted U-shaped relationship between temperature and consumption. Spending per bank card during a ten-day period decreases by ¥7 (P < 0.001; 95% CI, −9.86 to −4.22), or 5.9% of the daily spending per card, when the current day's temperature is above 85 °F, and by ¥4 (P = 0.002; 95% CI, −6.35 to −1.39), or 3.2% of the daily spending per card, when the temperature is below 10 °F, relative to the reference level. These reductions amount to ¥12.1 million and ¥6.9 million per day per city on average, respectively, relative to the level of daily spending at the reference temperature bin. The inverted U-shaped relationship estimated from equation (1) is robust to a number of model specifications, including the inclusion of pollution and weather controls, using log(consumption) as the dependent variable, adding city-specific time trends and using the number of days in each temperature bin as the key regressors (Extended Data Fig. 4). The distribution of the residuals is similar to a normal distribution but is more concentrated around zero. The residuals do not exhibit seasonality, suggesting adequate controls in the time dimension in our analysis (Extended Data Fig. 5). The results are also robust to extreme values, suggesting that the inverted U-shaped relationship between temperature and spending is not driven by the tails of the distribution (Extended Data Fig. 5).
To compare the effect size from our analysis with those in the literature, we interpret our results in two ways. First, each additional hot day (>85 °F) reduces the average daily spending per card by 5.9% (P < 0.001; 95% CI, −8.2% to −3.5%). Second, relative to the reference bin of 40-45 °F, linearizing the effect of temperature implies that the marginal impact of a one-unit increase in temperature on daily spending is (−5.9%)/(85 °F − 42.5 °F) = −0.14% per °F (P < 0.001; 95% CI, −0.19% per °F to −0.08% per °F). Deryugina and Hsiang 37 show that relative to a day with an average temperature of 59 °F, a day at 84.2 °F lowers annual income by roughly 0.065% (−0.00065 log points). Their results suggest that the marginal impact from a one-unit increase in temperature on daily income or productivity is −0.93% per °F. The impact on spending in our context is therefore about 15% of the impact on income in their context on the basis of this comparison. Spending is probably less responsive to temperature shocks than income, especially for household necessities. Given the differences in the outcome variables (income versus consumption) and the study contexts (the United States versus China), readers should be cautious in interpreting the differences in the effect size. Table 4 show the heterogeneity in the consumption-temperature relationship among eight subcategories: food, clothes, entertainment, transportation, department stores, cash, health and online purchases. Figure 2a shows that the temperature impact on food spending is close to zero, relative to the reference temperature bin, whereas Fig. 2b shows that spending on clothing decreases on both cold and hot days. The contrast is    consistent with the intuition that food stands first among all basic needs, and hence the impact of temperature shocks would probably be small. In comparison, clothing is more like durable goods from a ten-day perspective in that people can defer buying new clothes when hit by temperature extremes. Figure 2c shows that spending on entertainment decreases in cold weather and increases in hot weather, relative to the reference bin of 40-45 °F. Spending is lowest when the temperature is lowest (<10 °F) but highest when the temperature is 55-60 °F. Two countervailing forces are at play. First, as shown in ref. 14 , temperature shocks could reduce the marginal productivity of labour and shift the allocation of time away from labour and towards leisure. Second, temperature extremes make outdoor activities less pleasant and harder to conduct, especially during cold weather (for example, travel becomes harder). The results in Fig.  2c suggest that the first force dominates during hot days, while the second force dominates during cold days. Figure 2d shows that the impact of temperature shocks on transportation spending is similar to that on entertainment in Fig. 2c: cold weather has a negative effect on transportation spending, but hot weather has a positive impact. On the one hand, excessive heat and cold could reduce consumption activities and hence the need for driving. On the other hand, for activities that consumers have to carry out in person (for example, going to grocery stores or restaurants), consumers may increase car use as the preferred travel mode instead of using public transit or walking. In addition, the increase in entertainment activities could play a role in the increased spending on transportation on hot days. Figure 2e shows an inverted U-shaped relationship between temperature and spending in department stores. This means that extreme weather has negative effects on a variety of goods, particularly on hot days. Figure 2f shows that cash usage also decreases during temperature extremes, and the negative effect is particularly large on cold days. Figure 2g shows a positive impact on health spending (for example, in hospitals and pharmacies) during cold days. While temperature extremes could negatively impact human health [17][18][19] and hence increase spending in health-care facilities, these shocks could also reduce non-emergency visits and related spending due to avoidance behaviour. The net impact on health spending could thus be ambiguous a priori. The evidence suggests that the former channel dominates during cold days and is probably weaker during hot days. Figure 2h examines the effect of temperature shocks on online purchases. One may expect online purchases to be less sensitive to temperature shocks. In addition, consumers could shift from in-store visits to online purchases during extreme weather conditions, thus flattening or even reversing the inverted U-shaped pattern observed for in-store purchases. Our data on online transactions are limited in that electronic payment methods that have become popular since 2015 (notably WeChat and Alipay) are not settled through UnionPay and hence are excluded. Nevertheless, the analysis shows that online purchases in our data are insensitive to temperature except on cold days with temperatures <20 °F. Consumption reduction on cold days is probably driven by the fact that cold weather presents challenges for deliveries and pickups. Many urban residents live in condominiums, and goods purchased online are often delivered to a nearby location outside of the building (for example, the entrance of a gated community) for pickup. This pattern is not symmetrically observed on hot days, probably because the temperature decreases in the evening when people can pick up their deliveries. Overall, our limited data on online purchases show a less sensitive pattern.

Subcategories. Figure 2 and Supplementary
In sum, the inverted U-shape of overall spending is mainly driven by changes in the composition of spending across categories during temperature extremes, although some categories exhibit the inverted U-shaped impact by themselves (for example, clothes and cash). Additionally, for goods that are durable beyond ten days, the analysis of subcategories may not fully capture the temperature effects. Future research is warranted with richer data on transactions via popular electronic payment methods that have emerged in recent years.
Heterogeneous effects across climate zones. We estimate equation (1) separately by regions with hot, mild and cold climates. We use the 30-year average temperature from 1981 to 2010 to define the climate region. Hot, mild and cold regions are, respectively, those with 30-year average temperatures in the highest 30%, middle 30% and lowest 40% of the distribution. The results depicted in Fig. 3 and Supplementary Table 5 show important heterogeneity in the impact on consumption across climate regions, with cities in cold regions being more sensitive to hot weather and those in warm regions being more sensitive to cold weather. The results suggest that consumers in cold areas are better adapted to low temperatures, while households in hot areas are better able to cope with high temperatures, implying the important role of adaptation in addressing the negative consequences of temperature shocks. Adaptation could take place through a variety of human behaviour adjustments and changes in buildings' environments, such as installing indoor heating and cooling systems, improving the health-care system, and adopting new regulations in landscape and urban planning. Recent literature has documented the role of adaptation in examining the impact of temperature and climate shocks on human health 19,35 and agriculture, among other areas 9,38-40 .

Long-run projections.
To obtain long-run projections of the impact of climate change on consumption, we model adaptation by allowing the consumption-temperature relationship to vary by climate. We use a flexible semiparametric function to incorporate both daily temperature and climate conditions into the analysis (see Methods for the details) following the strategy in refs. 26,35 . In addition,  (1) includes day-of-the-sample fixed effects, city-by-year-quarter fixed effects, city-by-holiday fixed effects and a set of control variables including air pollution, precipitation and relative humidity.
The regression results are reported in Supplementary we follow ref. 36 to account for the role that income may play in adaptive behaviours by allowing the consumption-temperature relationship to vary by GDP per capita. Supplementary Table 6 presents the coefficient estimates for equation (2). To facilitate the interpretation of the coefficient estimates, Fig. 4 summarizes the results by plotting the consumption-temperature relationship for Harbin, Shanghai and Haikou under the current climate conditions. Harbin is the northernmost (coldest) capital city in China, Haikou is the southernmost (hottest) capital city and Shanghai is in the middle. Consistent with the results in Fig. 3, Harbin observes the largest decrease in consumption on hot days and the smallest decrease on cold days, as the city is already well adapted to its cold climate. In contrast, Haikou observes the largest decrease in consumption on cold days but is barely affected by hot days, as it is well adapted to its hot climate. In the long-run projections, we incorporate adaptation by allowing the consumption-temperature relationship to change as climate conditions change. That is, if Harbin's climate were to become similar to that in Shanghai by the end of the century, we would use the consumption-temperature relationship of Shanghai to simulate end-of-century consumption patterns in Harbin. The findings obtained from equation (2) are robust to a number of robustness checks, including the inclusion of pollution and other weather variables as controls, using log(consumption) as the dependent variable and adding city-specific time trends (Extended Data Fig. 6). In addition, we estimate a more flexible model of linear splines with knots at ten-degree increments, and we obtain similar results (see Supplementary Table 7 for the coefficient estimates and Extended Data Fig. 6d for the three-city plot).
Simulation results. For climate projections, we use two RCPs, which are greenhouse gas concentration trajectories and climate scenarios adopted by the Intergovernmental Panel on Climate Change's Fifth Assessment Report in 2014. RCP4.5 is a stabilization scenario in which emissions peak around mid-century under a range of mitigation strategies, while RCP8.5 is a business-as-usual scenario with emissions continuing to rise throughout the century. Under each RCP scenario, the main simulation results are produced using the median temperature and climate from an ensemble of 21 general circulation models (GCMs). The Methods section provides details on the data inputs and how our results reflect three sources of uncertainty in the simulations: emission uncertainty, climate uncertainty and regression uncertainty. Figure 5 depicts the projected changes in total annual national consumption during the 20-year period at the end of the century (2080-2099) relative to the 2018 level. Figure 5a shows the results without climate adaptation by holding the consumption-temperature relationship fixed at the current climate, hence shutting down adaptation in the projections. Therefore, the changes in consumption are driven only by the change of the temperature distribution. Figure 5b presents the results with climate adaptation by adjusting the consumption-temperature relationship to the future climate, hence incorporating adaptation. For each climate scenario, we show both the average impact at the national level and the impact in the three climate regions.
Two key findings emerge. First, without adaptation, Fig. 5a shows that annual national consumption at the end of century (2080-2099) would exhibit a statistically significant and economically important change of −0.37% (P = 0.005; 95% CI, −0.61% to −0.09%) under RCP4.5, and −0.86% (P = 0.003; 95% CI, −1.39% to −0.27%) under RCP8.5. These losses of aggregate spending nationally are equivalent to ¥148 billion and ¥344 billion under RCP4.5 and RCP8.5, respectively. The estimated projected changes in this panel are driven by the shift in the temperature distribution, implying that the decrease in consumption due to more hot days outweighs the increase in consumption due to fewer cold days under both climate scenarios. Figure 6a,b shows the heterogeneity across regions without adaptation under RCP4.5 and RCP8.5, respectively. The heterogeneity is also affected by the variation in income levels across cities: richer cities have a higher share of discretionary spending and are shown to be more sensitive to temperature shocks (see Supplementary Fig. 3 for the details).
The second key finding is that after adaptation is accounted for, the negative impact of future temperature shocks on consumption is mitigated. Figure 5a shows a statistically significant reduction in consumption at the national level without adaptation under both climate scenarios, but Fig. 5b shows an economically small and statistically insignificant impact once adaptation is taken into account. The heterogeneity across cities with adaptation is further shown in Fig. 6. Many cities in the south are predicted to observe an increase in consumption. These cities are well equipped to deal with heat, and as a result, the negative impact from more frequent hot days is dominated by the positive impact from less frequent cold days in the future. In comparison, some cities in the north are predicted to observe consumption reductions. The negative impact from more frequent heat events will be larger in the northern cities than that for their southern counterparts because even with adaptation, the northern cities are still less equipped to cope with heat. At the same time, as these cities adapt to a warmer climate, they are less able to cope with extreme cold events that will still occur, albeit less frequently. The differential impacts across cities highlight the environmental inequality documented in ref. 41 , as well as the importance of understanding the spatial heterogeneity of climate impacts across regions and countries using granular data.
The contrast between findings with and without adaptation highlights the critical role of adaptation in climate impacts and the need to better understand it 4 . The result that adaptation mitigates climate impacts is also documented in ref. 35 in the context of mortality in the United States. To examine the importance of adaptation  and the sensitivity of our results, we focus on the projection results if end-of-century temperatures were to be realized at the 90th percentile (instead of the median) of the predicted temperature distribution. Our simulations again show larger consumption reductions in the absence of adaptation: a statistically and economically significant change of −0.55% (P = 0.004; 95% CI, −0.90% to −0.16%) under RCP4.5, and −1.19% (P = 0.002; 95% CI, −1.89% to −0.39%) under RCP8.5, on an annual basis. The loss of national spending would amount to ¥220 billion and ¥476 billion, respectively. However, with adaptation, consumption reduction is again neither economically nor statistically significant for the country as a whole.

Discussion
Consumption is a key component in understanding economic growth, but past research on the impact of climate change on economic growth has mostly focused on production channels. This paper examines the direct effect of temperature shocks on household consumption behaviour by leveraging comprehensive and fine-scale data on consumer spending. In the short run, the analysis shows that temperature shocks have an immediate and negative effect on consumption. Supplementary Figs. 1 and 2 confirm that the consumption reduction from equation (1) is unlikely to be accounted for by intertemporal substitution. The consumption-temperature relationship may be explained by the physiological, psychological and cognitive burdens from temperature extremes [42][43][44][45][46][47] , as well as changes in human behaviour to avoid these burdens. Our finding is consistent with recent studies that document the negative impact of temperature extremes on outdoor activities 14,48,49 .
To predict the long-run impacts of climate change on consumption, we incorporate both the temperature impact and the adaptation channel in our simulations. Our results show that adaptation could reduce the negative consequences of temperature shocks from climate change for consumption and even reverse the direction of the impact, especially in hot regions. Two sets of countervailing forces are behind these findings. The first set comes from the shift in the temperature distribution and heterogeneous consumption responses to extreme heat and cold. On the one hand, under both the RCP4.5 and RCP8.5 scenarios, excessive heat becomes more common, which reduces consumption. On the other hand, excessive cold becomes less common, especially under RCP8.5, which could lead to increases in consumption. The second set of countervailing forces comprises adaptation to excessive heat versus de-adaptation to excessive cold. As the population adapts to a warmer climate and becomes more resilient to excessive heat over time, de-adaptation occurs on the other end of the temperature distribution, and excessive cold induces a stronger negative impact on consumption. Our results imply that adaptation's positive effect on consumption could dominate de-adaptation's negative effect, especially under RCP8.5 as the climate becomes warmer.
We end with several caveats. First, while transactions through the UnionPay network account for a large share of the overall retail consumption expenditure in 2018 (Extended Data Fig. 1), differences in coverage across consumption categories arise between the UnionPay data and the aggregate statistics from the National Bureau of Statistics (Supplementary Table 1). Particularly, electronic payment methods (WeChat and Alipay) have increased dramatically over time, and some of the observed relationship between temperature and spending could be driven by substitution between UnionPay and other payment methods. Second, the adoption of credit and debit cards is lower among rural and less-developed areas (Extended Data Fig. 2), so the findings should be interpreted as capturing the impact on urban residents. Third, temperature shocks could affect consumption through both the demand and supply channels. By examining the impact on aggregate consumer spending rather than on quantities and prices separately, our analysis quantifies the magnitude of the equilibrium outcome but is unable to disentangle the impacts through either channel. We consider these limitations as important questions for future research.  Fig. 2 shows the spatial pattern of card adoption by plotting the number of active cards per resident by city in 2015. Card adoption is high throughout the country, especially in coastal and high-income cities. In addition, the penetration tends to be higher in cities with a more educated and younger population 51 . UnionPay transactions cover seven major merchant categories and over 300 subcategories. Supplementary Table 1 compares the shares by consumption category from UnionPay transactions with those from the National Bureau of Statistics in 2015. Some categories exhibit large differences in shares. For example, the shares for 'Food' and 'Clothing' are much smaller in UnionPay transactions. Consumers may use cash for small transactions in these categories. In addition, some food-and clothing-related transactions are classified into other categories in UnionPay, which uses merchants' core businesses to group transactions. Despite these differences, the UnionPay transactions provide comprehensive and fine-scale data in temporal and spatial dimensions on consumer spending in China.
The UnionPay data that we have access to contain information on transaction volume and monetary value by city, consumption category and day for offline transactions. Information on consumer categories is not populated for online transactions, limiting our ability to understand online purchasing behaviour. Our analysis uses data from 1 January 2013 to 31 December 2018 in the 283 largest cities in China, which account for over 96% of the population and 98% of consumer spending. The top panel in Supplementary Table 2 reports summary statistics on the transaction data. The daily consumption per card is ¥120 on average. We exclude observations with the top and bottom 1% of spending per card, as ordinary least squares is sensitive to outliers.
Meteorology and air pollution data. The weather data are ERA-Interim products from the European Center for Medium-Range Weather Forecasts. This centre provides daily meteorology information such as temperature, precipitation, wind speed and humidity from 1979 to the present at the 79-km-grid resolution. Extended Data Fig. 3 plots the fraction of days by temperature bin over 2013-2018, for cities in the highest 30%, the middle 30% and the lowest 40% of the distribution of 30-year average temperatures from 1981 to 2010. We merge the transaction data  The projections from the NEX-GDDP dataset have the same unit of analysis (that is, by city and day) as our baseline model. Similar to the meteorology data, the centroid of a city from the transaction data is linked with the nearest grid point from the NEX-GDDP dataset. Our main results are produced using the median projected temperature and climate from the 21 GCMs.
Socio-economic projections. The future GDP and population projections are from the Shared Socioeconomic Pathways (SSPs). The SSPs depict a set of plausible scenarios of socio-economic development over the twenty-first century that are predicted by integrated assessment modelling 53 . We obtained SSP2, SSP3 and SSP4 projections that yield carbon emissions that fall between RCP4.5 and RCP8.5 in integrated assessment modelling exercises 36,54 . While there are many models in the SSP database, we adopt the following three sets of projections that include China: the Organization for Economic Co-operation and Development (OECD) Env-Growth model 55 , the International Institute for Applied Systems Analysis (IIASA) GDP model 56 and the Potsdam Institute for Climate Impact Research (PIK) model 57 . The GDP per capita that we use for our analysis is obtained by averaging across the SSP2, SSP3 and SSP4 scenarios in the OECD, IIASA and PIK projections. GDP per capita does not differ between the RCP4.5 and RCP8.5 scenarios, as this practice does not provide additional information in our context. GDP per capita was originally in five-year increments at the national level. We use the implied annual growth rate to construct the projected GDP per capita in each future year. In the absence of city-specific projections from SSPs, we apply the national growth rate between 2018 and future years uniformly across cities.

Econometric models. Short-run effects.
To examine the effects of temperature on consumption behaviour, we estimate the following parsimonious model: where y c,t is the value of transactions per card in city c at time (day) t. {TP j c,t } J j=0 is a vector of 5 °F bins. TP j c,t equals one if the average daily temperature during the past ten days (t − 9 to t) in city c falls in the jth temperature bin and zero otherwise. x c,t is a set of control variables including air pollution, precipitation and relative humidity. η t is day-of-the-sample fixed effects to control for unobserved common shocks (for example, national holidays). City-by-year-quarter fixed effects, κ c,s , capture city-specific and time-varying shocks such as the adoption of card payment by merchants, economic fluctuations and political events (for example, an anticorruption campaign that started in early 2013). In addition, the regression includes city-by-holiday fixed effects. ε c,t is the error term.
We set the temperature bin that exhibits the largest impact as the reference bin. The approach of using temperature bins offers a non-parametric method to capture the nonlinearities in the consumption-temperature relationship. The coefficient of interest, β j , in equation (1) can be equivalently interpreted as the cumulative consumption impact of the past ten days' temperature in temperature bin j relative to the reference bin. β j can also be interpreted as the impact of the current day's temperature j on cumulative consumption during a ten-day period (the current day and the nine subsequent days), relative to the reference bin. The regression is weighted by a city's number of active cards at the beginning of the sample period (1 January 2013). We cluster the standard errors at the city level to account for autocorrelation in the error term. We further compute Conley standard errors to address the spatial correlation in the error term 58,59 . These adjustments do not change the inference results qualitatively. All statistical tests in this work are two-tailed tests.
This model is equivalent to a distributed lag model that focuses on the aggregate impact during the ten-day time window. An alternative approach would be to include lagged temperature variables for each of the past ten days. However, high autocorrelation among these daily variables produces oscillating and imprecise coefficient estimates, as shown in Supplementary Fig. 1. We specify a window of ten days prior to date t to capture the lagged effects as well as intertemporal substitution. For health spending, there might be an incubation period for illnesses to show symptoms after exposure to excessive heat or cold, or a lag between symptoms and treatment that is captured in our data. In addition, consumers may reschedule their shopping or entertainment activities to later dates in response to excessive heat or cold on a given day. The ten-day window allows us to capture the temporal replacement within the time window and estimate the net effect (for example, permanent changes). We discuss the choice of window length below.
The key variation for identification is the within-quarter and within-city changes in temperature. The identifying assumption is that changes in temperature experienced by a city are exogenous to unobserved time-variant factors that affect consumption behaviour in the city. This assumption is plausible because of the randomness of temperature fluctuations and the rich set of controls for factors that could be correlated with both temperature and consumption. As illustrated by Extended Data Fig. 4, our results are robust to alternative model specifications with: (1) different sets of control variables, (2) log(consumption) as the dependent variable, (3) city-specific time trends instead of city-by-year-quarter fixed effects and (4) the number of days in each temperature bin as key regressors rather than the average-temperature bin. Our results are also robust to potential bias from extreme values and substitution across different payment types, as illustrated in Extended Data Fig. 5 and Supplementary Fig. 5.
Next, we estimate additional models to examine the role of intertemporal (day-to-day) substitution as well as determine how many day-lags should be included in equation (1). Ideally, our empirical framework should start from estimating the day-specific temperature impact to determine how many day-lags should be added to the model. However, due to the high autocorrelation in daily temperature variables, estimating the coefficients for 17 temperature bins per day is difficult for any reasonable window length. We thus resort to two alternative methods.
First, we follow ref. 17 and include three temperature bins (below 30 °F, between 30 °F and 90 °F, and above 90 °F) for each day over a 15-day window (day t − 14 to t). The reference bin is the temperature between 30 °F and 90 °F. To provide additional evidence on causality, we add temperature bins in the next three days as a placebo test. Supplementary Fig. 1 illustrates that the scope of intertemporal substitution and lagged effects of temperature shocks are likely to be limited to ten days for most consumption activities, motivating the ten-day time window in our baseline analysis.
Second, we test the significance of the consumption impacts of 51 average-temperature bins corresponding to the three five-day windows: past day t − 4 to t, t − 9 to t − 5 and t − 14 to t − 10. That is, we keep the same 17 temperature bins as in equation (1) for each time window. The results, presented in Supplementary Fig. 2a, support our choice of the ten-day window. As a falsification test, we add in equation (1) the average-temperature bins based on the future five days. As shown in Supplementary Fig. 2b, after controlling future temperature bins, the impacts from the last ten days are similar to the baseline regression (equation (1)), and the impacts from the future five days are close to zero, supporting the notion that our estimated effects are not spurious.
Long-run projections with adaptation. As the climate changes gradually over time, we would expect adaptation to occur through various channels including physiology, behaviour, technology, and investment by households and governments. The consumption-temperature relationship would therefore change with climate, as illustrated in Fig. 3. To capture how the consumptiontemperature relationship varies by climate in the presence of adaptation, we use a semiparametric function to incorporate both daily temperature and climate conditions into the analysis, following the strategy in refs. 26,35 , which study energy demand and mortality impacts from climate change. Essentially, we quantify the future adaptation of a given location to climate change on the basis of the historical adaption behaviour of another location to which the climate of the given location is converging.
Existing studies document that income may affect adaptation to climate changes 36,60 . To account for the role of income in the consumption-temperature relationship, our model includes the interactions between temperatures and log GDP per capita in the spirit of ref. 36 . As illustrated by the theoretical framework in ref. 36 , climate captures the adaptive behaviour through various channels, and income reflects the budget constraints governing adaptation. The model is specified as: yc,t = f(TPc,t, CMc, GDPc;θ) + xc,t ρ + η t + κc,s + ϵc,t, where (2) f(TPc,t, CMc, GDPc;θ) = α0TPc,t + α1TPc,t × (TPc,t ∈ [40, 60)) +α2TPc,t × (TPc,t ≥ 60)  (2) are defined the same way as in equation (1). θ is a vector of parameter estimates in equation (2). The parameter estimates are reported in Supplementary Table 6. By allowing the slope of the consumption-temperature function to vary by climate condition, this specification recovers the consumption-temperature relationship for a continuum of climate conditions. To examine the robustness of equation (2), we perform the following tasks and plot the results in Extended Data Fig. 6: (1) adding different sets of control variables, (2) using log(consumption) as the dependent variable, (3) replacing city-by-year-quarter fixed effects with city-specific linear time trends and (4) using a more flexible spline with knots at ten-degree increments from 40 °F to 90 °F. The coefficient estimates for this more demanding spline specification are reported in Supplementary Table 7. Our results are robust to these alternative specifications. In estimating the parameters in equation (2), CM c and GDP c are fixed during our data period of 2013-2018. In long-run projections, we allow these two variables to evolve. To account for climate adaptation in the long run, we use the consumption-temperature relationship based on the future (rather than current) climate condition of a given city from global climate projections. Specifically, in the projections with climate adaptation, we estimate the change of consumption in a future year τ relative to the 2018 consumption as: captures the role of climate adaptation. In our simulations, we use projected future GDP per capita throughout-that is, GDP in equations (3) and (4) has the subscript τ. Our simulations therefore do not capture the full impact of income growth on consumption changes. The role of income is incorporated only through its impact on the slope of the consumption-temperature relationship, not through its impact on the level of consumption, as discussed in detail in the Supplementary  Information (Supplementary Fig. 4).
Uncertainty. Three sources of uncertainty exist: emission uncertainty, climate uncertainty and regression uncertainty 61 . Emission uncertainty refers to the imperfect knowledge of the future trajectory of anthropogenic activities that might affect the climate system (for example, RCP4.5 or RCP8.5). Climate uncertainty refers to the uncertainty in how the climate system responds to a given level of emissions. An ensemble of 21 GCMs is typically used in national and international climate assessments. Regression uncertainty stems from the econometric estimates of response functions using historical data-that is, uncertainty in the regression coefficient estimates.
To account for regression uncertainty, we follow the procedure in 36,62,63 to randomly draw a set of parameters 100 times from a multivariate normal distribution characterized by the covariance matrix for the parameter estimates in f(⋅) in equation (2). Next, we construct a predicted response function (for each city and each day in 2080-2099) by combining these parameter draws with the median values (location-and time-specific) of temperature and climate provided by the 21 climate projections. Last, we take the 2.5th and 97.5th percentiles from the distribution of the outcomes to construct the 95% CI. To account for emission uncertainty, we report results under both the RCP4.5 and RCP8.5 scenarios. To account for climate uncertainty, besides the median value, we further discuss our key results using the 90th percentile values of temperature and climate provided by the 21 climate projections.
Reporting Summary. Further information on research design is available in the Nature Research Reporting Summary linked to this article.

Data availability
The credit and debit card transaction data that support the findings of this study are from UnionPay and are confidential. We cannot disclose the data to the public under the nondisclosure agreement. Interested researchers can contact UnionPay Advisors at 86-21-61005911 or yinlianzhice@unionpayadvisors.com. The air pollution and weather data for this analysis are from public sources (https://www. ecmwf.int/en/forecasts/datasets/reanalysis-datasets/era-interim and https://air. cnemc.cn:18014/). The data are also uploaded to Zenodo (https://zenodo.org/ record/5830776#.YdzLOWhBxPY). Source data are provided with this paper.

Code availability
All computer codes and a readme file for this analysis are provided on Zenodo (https://zenodo.org/record/5830776#.YdzLOWhBxPY).
The consumption data are from the universe of credit and debit card transactions in China settled through the UnionPay network. The weather data are ERA-Interim products from the European Center for Medium-Range Weather Forecasts (ECMWF). Air pollution index by city by day is from the Ministry of Ecology and Environment (formerly the Ministry of Environmental Protection) in China The credit and debit card transactions data that support the findings of this study are from UnionPay and are confidential. We cannot disclose the data to the public under the nondisclosure agreement. Interested researchers can contact UnionPay Advisors at 86-21-61005911, or yinlianzhice@unionpayadvisors.com. Air pollution and weather data for this analysis are from public sources (https://www.ecmwf.int/en/forecasts/datasets/reanalysisdatasets/era-interim and https:// air.cnemc.cn:18014/). The data are also uploaded to Zenodo (https://zenodo.org/record/5830776#.YdzLOWhBxPY).
Corresponding author(s): Shanjun Li Last updated by author(s): Jan. 12,2022 Reporting Summary Nature Research wishes to improve the reproducibility of the work that we publish. This form provides structure for consistency and transparency in reporting. For further information on Nature Research policies, see our Editorial Policies and the Editorial Policy Checklist.
Please do not complete any field with "not applicable" or n/a. Refer to the help text for what text to use if an item is not relevant to your study. For final submission: please carefully check your responses for accuracy; you will not be able to make changes later.

Statistics
For all statistical analyses, confirm that the following items are present in the figure legend, table legend, main text, or Methods section.

n/a Confirmed
The exact sample size (n) for each experimental group/condition, given as a discrete number and unit of measurement A statement on whether measurements were taken from distinct samples or whether the same sample was measured repeatedly The statistical test(s) used AND whether they are one-or two-sided Only common tests should be described solely by name; describe more complex techniques in the Methods section.
A description of all covariates tested A description of any assumptions or corrections, such as tests of normality and adjustment for multiple comparisons A full description of the statistical parameters including central tendency (e.g. means) or other basic estimates (e.g. regression coefficient) AND variation (e.g. standard deviation) or associated estimates of uncertainty (e.g. confidence intervals) For null hypothesis testing, the test statistic (e.g. F, t, r) with confidence intervals, effect sizes, degrees of freedom and P value noted

Software and code
Policy information about availability of computer code Data collection

Data analysis
For manuscripts utilizing custom algorithms or software that are central to the research but not yet described in published literature, software must be made available to editors and reviewers. We strongly encourage code deposition in a community repository (e.g. GitHub). See the Nature Research guidelines for submitting code & software for further information.

Data
Policy information about availability of data All manuscripts must include a data availability statement. This statement should provide the following information, where applicable: -Accession codes, unique identifiers, or web links for publicly available datasets -A list of figures that have associated raw data -A description of any restrictions on data availability 1 The analysis is performed using Stata version 15.1.

nature research | reporting summary
April 2020 The study is a quantitative study based on observational (non-experimental) data and simulations.
n/a Involved in the study Reporting for specific materials, systems and methods We require information from authors about some types of materials, experimental systems and methods used in many studies. Here, indicate whether each material, system or method listed is relevant to your study. If you are not sure if a list item applies to your research, read the appropriate section before selecting a response.

Materials & experimental systems Methods
This checklist template 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 license, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons license 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 license, visit http://creativecommons.org/licenses/by/4.0/ 2 The research sample is based on all the credit and debit card transactions settled through UnionPay from 2013 to 2018 The transaction-level data are aggregated to the city by day by spending category (such as restaurant, movie theaters etc.) from January 1, 2013 to December 31, 2018. We focus on the 283 largest cities in China, accounting for over 96% of the population and 98% of consumer spending through UnionPay.
The final data for analysis is based on the universe of credit and debit card transaction. The transaction-level data are aggregated to city by day by spending category.
The data are transaction records settled through UnionPay, the only inter-bank payment system in China and the largest by transaction volume and amount in the world. January 1, 2013 to December 31, 2018 There are about 6,000 (or 1\%) missing observations from the process of data quality control by UnionPay. The process removed transactions deemed as fraudulent (a practice called illegal cash out) rather than real transactions N/A N/A nature research | reporting summary