Silviase/jgov_v1.4_full_ann huggingface dataset:
One of the surprising features of this setup is that markups prove to be the same across all products sold by retail firm r. This is a generic property of nested demand systems. The intuition is that the retail firm internalizes that it is the monopoly supplier of its real output, which in our model equals real consumption of the retail firm's bundle of product groups, $ C_{rt} $ , and products, $ C_{grt} $ . Hence, the retail firm's profit maximization problem can be thought to consist of two stages. First, the retail firm chooses the price index ( $ P_{rt} $ and $ P_{grt} $ ) to maximize its profits from supplying $ C_{rt} $ and $ C_{grt} $ , which implies a markup at the firm level over the cost of supplying real output. Second, the retail firm chooses the price of each product to minimize the cost of supplying real output within the product group ( $ C_{grt} $ ), which requires setting the relative prices of products equal to their relative marginal costs. Together, these two results ensure the same markup across all product groups and products sold by the retail firm. Nonetheless, markups vary across retail firms.

In the Bertrand case, retail firms with a higher market share $ (S_{rt}) $ face a lower perceived elasticity of demand and thus set a higher markup, as in previous studies (Atkeson and Burstein, 2008; Edmond et al., 2012; Hottman, 2016). Although consumers have constant elasticity of substitution preferences $ (\sigma_{R}) $ , each firm perceives a variable elasticity of demand $ (\varepsilon_{rt}) $ , which is decreasing in its market share $ (S_{rt}) $ . As a result, the retail firm's equilibrium pricing rule (9) involves a variable markup that is increasing in its market share. For a positive equilibrium price (9), the perceived elasticity of demand $ (\varepsilon_{rt}) $ needs to be greater than one (retail firm supply substitutes), which requires the elasticity of substitution between retail firms $ (\sigma_{R}) $ to be sufficiently large. As a firm's market share approach zero, the markup approaches the standard CES markup of $ \mu_{rt}=\frac{\sigma_{R}}{\sigma_{R}-1} $ .

### 3.3 Decomposition of retail firms' sales

In this section, we use the model to quantify the contribution of the different sources of retail firm heterogeneity to the dispersion in sales across retail firms. The nominal sales of retail firm r, $ E_{rt} $ , are given by

$$ E_{r t}{=}\sum_{g\in G_{r t}}\sum_{u\in U_{g r t}}P_{u r t}Q_{u r t}. $$

Using the quantity demanded of each product at each retail firm (8), the price indexes (3) and (5), and the equilibrium pricing rule (9), and taking the logarithm, we obtain
$$ \begin{align*}\ln E_{rt}=&\ln E_{t}+(\sigma_{R}-1)\ln P_{t}+(\sigma_{R}-1)\ln\varphi_{rt}+\left(\frac{\sigma_{R}-1}{\sigma_{G}-1}\right)\ln N_{G_{rt}}-(\sigma_{R}-1)\ln m_{rt}\\&-(\sigma_{R}-1)\ln\mu_{rt},\end{align*} $$

where $ m_{rt} $ is a marginal cost index of retail firm r, which is defined as

$$ m_{r t}=\left[\frac{1}{N_{G r t}}\sum_{g\in G_{r t}}\left(\frac{m_{g r t}}{\varphi_{g r t}}\right)^{1-\sigma_{G}}\right]^{\frac{1}{1-\sigma_{G}}}, $$

where $ m_{grt}=\left[\sum_{u\in U_{grt}}\left(\frac{m_{urt}}{\varphi_{urt}}\right)^{1-\sigma_{Ug}}\right]^{\frac{1}{1-\sigma_{Ug}}} $ . $ m_{rt} $ is a composite index of marginal costs weighted-ed by both the quality of each product ( $ \varphi_{urt} $ ) and the quality of each product group ( $ \varphi_{grt} $ ).

Equation (12) decomposes the retail firm's sales into seven terms that capture various factors through which firms can differ in sales. The first two terms capture macro- or semi-macroeconomic factors, namely, the size of the market $ (E_{t}) $ for and price level $ (P_{t}) $ of the commodities that all retail firms supply. Our demand system is homogeneous of degree one in consumer spending at each retail firm, so firm's sales rise one to one with an increase in aggregate expenditures. The second term captures the impact of the price index for total consumption, which summarizes the prices of the output of competing retail firms. An increase in the price index of one percent will cause the firm's sales to rise by $ (\sigma_{R}-1) $ percent. Here, the elasticity of substitution between retail firms plays a crucial role in determining how much a price movement affects a retail firm's sales.

The next two terms capture the impact of the quality aspects of each retail firm. The third term captures the impact of firm-level service quality $ \left(\varphi_{rt}\right) $ . Again, the elasticity of substitution between retail firms determines how much the movement of overall quality affects a retail firm's sales.

The fourth term captures the contribution of product scope at the product-group level. Let us first consider two retail firms that provide the same level of overall service quality $ \left(\varphi_{rt}=\varphi_{rt}^{\prime}\right) $ , but one retail firm supplies more product groups than the other $ \left(N_{G_{rt}}>N_{G_{rt}^{\prime}}\right) $ . For simplicity, assume all product groups and all products are of identical quality $ \left(\varphi_{gst}=\varphi_{ust}=1\right. $ for all $ g\in G_{st} $ and $ u\in U_{gst} $ and have identical marginal costs $ \left(z_{urt}=z\right. $ for all $ g\in G_{st} $ and $ u\in U_{gst} $ for both retail firms $ (s=r,r^{\prime}) $ . For example, if consumers treated all product groups identically regardless of which retail firm supplies them, i.e., $ \sigma_{G}=\sigma_{R} $ , retail firm r would sell $ \ln\left(N_{G_{rt}}/N_{G_{rt}^{\prime}}\right) $ percent more than retail firm $ \dot{r} $ . More generally, if the product groups supplied by a retail firm are more
substitutable for one another than for those of other retail firms, i.e., $ \sigma_{G} > \sigma_{R} $ , the percentage gain in sales accruing to a retail firm that adds a product group will be less than one, reflecting the fact that the new product group will cannibalize the sales of its existing product groups.

The sixth and seventh terms capture the contribution of the firm-level relative price, which is decomposed into the marginal cost $ (m_{rt}) $ and the markup $ (\mu_{rt}) $ . Again, the elasticity of substitution between retail firms determines how much the movement of marginal costs and markups affects firm sales.

In order to remove the effect of aggregate expenditure and price movements, and thereby focus on the cross-sectional determinants of a retail firm’s sales and sales growth, we first decompose a retail firm’s sales relative to the average sales of the retail industry:

$$ \varDelta^{R}\ln E_{r t}=(\sigma_{R}-1)\varDelta^{R}\ln\varphi_{r t}+\left(\frac{\sigma_{R}-1}{\sigma_{G}-1}\right)\varDelta^{R}\ln N_{G r t}-(\sigma_{R}-1)\varDelta^{R}\ln m_{r t}-(\sigma_{R}-1)\varDelta^{R}\ln\mu_{r t} $$

where $ \varDelta^{R} $ is the difference operator relative to the geometric mean for all retail firms of all retail categories, such that $ \varDelta^{R}\ln E_{rt}=\ln E_{rt}-(1/N_{Rt})\sum_{k\in R_{t}}\ln E_{kt} $ , where $ N_{Rt} $ is the number of retail firms at time t.

We can now decompose the cross-sectional variation in retail firms' sales using a procedure analogous to the variance decomposition developed by Eaton et al. (2004) and widely used in the international trade literature. Specifically, we regress each of the components of the log of a retail firm's sales in the decomposition (13) on the log of the retail firm's sales as follows:

$$ \left(\sigma_{R}-1\right)\varDelta^{R}\ln\varphi_{r t}=\alpha^{\varphi}\varDelta^{R}\ln E_{r t}+\varepsilon_{r t}^{\varphi} $$

$$ \left(\frac{\sigma_{R}-1}{\sigma_{G}-1}\right)\varDelta^{R}\ln N_{G_{r t}}=\alpha^{N_{G}}\varDelta^{R}\ln E_{r t}+\varepsilon_{r t}^{N_{G}} $$

$$ -(\sigma_{R}-1)\varDelta^{R}\ln m_{r t}=\alpha^{m}\varDelta^{R}\ln E_{r t}+\varepsilon_{r t}^{m} $$

$$ -(\sigma_{R}-1)\varDelta^{R}\ln\mu_{r t}=\alpha^{\mu}\varDelta^{R}\ln E_{r t}+\varepsilon_{r t}^{\mu} $$

We allow the coefficients $ (\alpha^{\varphi}, \alpha^{N_{G}}, \alpha^{m}, \alpha^{\mu}) $ to differ across retail categories. Due to the properties of ordinary least squares (OLS) estimation, this decomposition allocates the covariance terms between the components of retail firms' sales equally across those components, and implies $ \alpha^{\varphi} + \alpha^{N_{G}} + \alpha^{m} + \alpha^{\mu} = 1 $ . The values for each of the $ \alpha $ 's provide us with a measure of how much of the variation in retail firms' sales can be attributed to each component.
### 4. Structural Estimation

Our structural estimation has two components for each tier. First, given the elasticity of substitution at each tier $ \left(\sigma_{Ug}, \sigma_{G}, \sigma_{R}\right) $ and the data on expenditure shares and prices $ \left(S_{urt}, S_{grt}, S_{rt}, P_{urt}\right) $ , we show how we can recover the unobserved service quality $ \left(\varphi_{urt}, \varphi_{grt}, \varphi_{rt}\right) $ . Second, given the elasticity of substitution across retail firms, we show how we recover the unobserved markups and marginal costs. Finally, we explain the strategy for estimating the elasticity of substitution at each tier of demand.

### 4.1 Recovering Unobserved Service Quality, Retail Markups, and Marginal Costs

#### 4.1.1 Quality

Consider the lowest-tier of the demand system. Given the elasticity of substitution between products, $ \sigma_{Ug} $ , and the observed data on product-level expenditure shares and prices $ (S_{urt}, P_{urt}) $ , the CES expenditure share of each product (equation (2)), together with $ \varphi_{ürt}=1 $ , the unobserved quality of each product is given by

$$ \varphi_{urt}=\frac{P_{urt}}{P_{\bar{urt}}}\cdot\left(\frac{S_{urt}}{S_{\bar{urt}}}\right)^{\frac{1}{\sigma_{Ug}-1}}. $$

Substituting the unobserved quality and observed barcode price of each product into equation (3) yields the price indices for each product group, $ P_{grt} $ . Similarly, given the elasticity of substitution between product groups, $ \sigma_{G} $ , the observed data on group expenditure shares, $ S_{grt} $ , and the estimated price indices for each product group, $ P_{grt} $ , the CES expenditure share of each product group (equation (4)) yields the unobserved quality of each product group, $ \varphi_{grt} $ . The price index for each retail firm, $ P_{rt} $ , and the unobserved retail-level service quality, $ \varphi_{rt} $ , can be calculated through similar steps.

#### 4.1.2 Retail Markups and Marginal Costs

Given the elasticity of substitution between retail firms, $ \sigma_{R} $ , equation (10) or (11) yields the retail firm's perceived elasticity of demand, $ \varepsilon_{rt} $ , which can then be used to compute the retail firm's markup, $ \mu_{rt} $ . Marginal costs, $ m_{urt} $ , can then be computed from the observed barcode price using equation (9).
### 4.2 Estimating the elasticities of substitution

We now explain our methodology for estimating the elasticities of substitution at each tier $ (\sigma_{Ug}, \sigma_{G}, \sigma_{R}) $ and the elasticity of marginal costs $ (\delta_{g}) $ .

#### 4.2.1 Lower tier of demand

Estimation of the elasticity of substitution in the lowest tier follows the approach employed by Broda and Weinstein (2006, 2010), which in turn is based on Feenstra (1994). The identification is as follows. In our setting, the slopes of the demand and supply curves for a given product group, $ \sigma_{Ug} $ and $ \delta_{g} $ , are assumed to be constant across products and over time, but their intercepts are allowed to vary across products and time. As Leontief (1929) points out, if the supply and demand intercepts for a given product are orthogonal, there is a rectangular hyperbola in $ (\sigma_{Ug}, \delta_{g}) $ space which best fits the observed price and share data of that product. The orthogonality assumption alone does not provide identification: a higher value of $ \sigma_{Ug} $ but lower value of $ \delta_{g} $ , for example, will keep the expectation at zero. If the variances of the supply and demand intercepts are heteroskedastic across products in a product group, then the hyperbolas that fit the data are different for each product. Since the slopes of the demand and supply curves are the same, the intersection of the hyperbolas of the different products in the product group separately identifies the demand and supply elasticities (Feenstra 1994).

The rest of this subsection defines the orthogonality conditions for each product in terms of its double-differenced supply and demand intercepts and outlines the generalized method of moments (GMM) procedure for estimating the slopes of the demand and supply curves for each product group.

We take the double-difference of the log of the expenditure share of each product (equation (2)) over time and relative to the average share of all products in the same product group supplied by retail firm r:

$$ \varDelta^{U,t}\mathrm{l n}S_{u r t}=-(\sigma_{U g}-1)\varDelta^{U,t}\mathrm{l n}P_{u r t}+\omega_{u r t}, $$

where the unobserved error term is $ \omega_{urt}=-(\sigma_{Ug}-1)(\Delta^{t}\ln\varphi_{urt}-\Delta^{t}\ln\varphi_{urt}).\;\Delta^{U,t} $ is the double-difference operator across products and over time such that $ \Delta^{U,t}\ln S_{urt}=\Delta^{t}\ln S_{urt}-\Delta^{t}\ln S_{urt} $ and $ \ln S_{urt}=(1/N_{U_{grt}})\sum_{v\in U_{grt}}\ln S_{vrt} $ , while $ \Delta^{t} $ is the first-difference operator over time such that $ \Delta^{t}\ln S_{urt}=\ln S_{urt}-\ln S_{urt-1} $ . Since we difference the product expenditure share relative to the average share, we eliminate all demand
shocks that are common across products in the same product group supplied by retail firm r, which leaves only demand shocks that affect the sales of a certain product relative to other products.

Transforming the equilibrium pricing rule (9) using $ Q_{urt}=(S_{urt}\sum_{v\in U_{grt}}E_{vrt})/P_{urt} $ and taking the double-difference of its log over time and relative to the average price of all products in the same product group supplied by retail firm r, we obtain

$$ \varDelta^{U,t}\mathrm{ln}P_{urt}=\frac{\delta_{g}}{1+\delta_{g}}\varDelta^{U,t}\mathrm{ln}S_{urt}+\kappa_{urt}, $$

where the unobserved error term is $ \kappa_{urt}=\frac{1}{1+\delta_{g}}(\Delta^{t}\ln z_{urt}-\Delta^{t}\ln z_{urt}) $ . Note that since the retail markup $ \mu_{rt} $ has been differenced out through the double-difference operation, our estimation approach is the same under either price or quantity competition, and hence is robust across these different forms of competition.

Following Broda and Weinstein (2006), the orthogonality of the double-differenced demand and supply shocks defines the set of moment conditions for each product:

$$ G(\beta_{g})=\mathbb{E}_{\mathrm{T}}\left[x_{u r t}(\beta_{g})\right]=0, $$

where $ \beta_{g}=\begin{pmatrix}\sigma_{Ug}\\\delta_{g}\end{pmatrix} $ , $ x_{urt}=\omega_{ut}\kappa_{urt} $ , and $ E_{T} $ is the expectations operator over time.

This condition assumes orthogonality of idiosyncratic demand and supply shocks at the product level. This orthogonality is plausible for the following reasons. First, differencing across products within the same product group supplied by retail firm r eliminates common firm-level shocks (e.g., changes in management) and common group-level shocks (e.g., renewal of the wine cellar) that affect both costs and appeal (quality or taste) across all products within the firm or within the product group. Similarly, differencing over time eliminates time-invariant heterogeneity between products caused by different production technologies, which could affect both costs and appeal (quality or taste) in all time periods. Therefore our double differencing nets out both these types of shocks. In other words, our identification is based only on relative differences in the demand for and supply of individual products. Another main potential threat to identification is a change in observable product characteristics that affects both relative costs and relative appeal, but this endogeneity concern does not arise with barcode data. Fortunately, any substantive change in product characteristics is accompanied by the introduction of a new bar code. Therefore, by using the variation within bar codes over time, we hold constant observable product characteristics. As a result, it is much harder to think of reasons why double-differ-
enced changes in costs that leave the observable characteristics of a product constant (e.g., changes in buying-in prices caused by a strike at a manufacturer or changes in raw material prices) should affect double-differenced consumer demand for that product conditional on price.

For each product group, we stack all the moment conditions to form the GMM object function and obtain

$$ \widehat{\beta}_{g}=\underset{\beta_{g}}{\operatorname{a r g m i n}}\left\{G^{*}(\beta_{g})^{\prime}\cdot W\cdot G^{*}(\beta_{g})\right\}\quad\forall g, $$

where $ G^{*}(\beta_{g}) $ is the sample analog of $ G(\beta_{g}) $ and W is a positive definite weighting matrix. As in Broda and Weinstein (2006), we weight the data for each product by the number of consumers who bought the product in each quarter. $ ^{10} $

#### 4.2.2 Middle tier of demand

We take the double-difference of the log of the product group expenditure share (equation (4)) over time and relative to the average share of all product groups supplied by retail firm r:

$$ \begin{array}{r}{\varDelta^{G,t}\mathrm{l n}S_{g r t}=-\left(\sigma_{G}-1\right)\varDelta^{G,t}\mathrm{l n}P_{g r t}+\omega_{g r t},}\end{array} $$

where the unobserved error term is $ \omega_{grt}=-(\sigma_{G}-1)\Delta^{G,t}\ln\varphi_{grt}.\Delta^{G,t} $ is the double-difference operator across product groups and over time such that $ \Delta^{G,t}\ln S_{grt}=\Delta^{t}\ln S_{grt}-\Delta^{t}\ln S_{grt} $ and $ \overline{\ln S_{grt}}=(1/N_{Grt})\sum_{h\in G_{rt}}\ln S_{hrt} $ , while $ \Delta^{t} $ is the first-difference operator over time such that $ \Delta^{t}\ln S_{grt}=\ln S_{grt}-\ln S_{grt-1} $ .

OLS estimation of equation (15) may be biased due to endogeneity, since the unobserved error term is likely to be correlated with the double-differenced product group price index. This correlation occurs because a relative increase in product group quality raises the quantity demanded of the products within the product group and thus raises the product group price index, since product supply curves are upward sloping.

We therefore estimate $ \sigma_{G} $ using an instrumental variable (IV) approach. The double-differenced product group price index can be written as:
$$ \varDelta^{G,t}\ln P_{g r t}=\varDelta^{G,t}\ln\widetilde{P}_{U_{g r t}}-\varDelta^{G,t}\Bigg[\frac{1}{\sigma_{U g}-1}\ln\Big(\sum_{u\in U_{g r t}}\frac{S_{u r t}}{\widetilde{S}_{U_{g r t}}}\Big)\Bigg]-\varDelta^{G,t}\ln(\prod_{u\in U_{g r t}}\varphi_{u r t})^{\frac{1}{N_{U_{g r t}}}}.\ (16) $$

The first term on the right-hand side of equation (16) is the natural log of the geometric mean of product prices within the product group. This term is the reason why the product group price index is correlated with the error term in equation (15). That is, increases in product group prices from movements along upward sloping product supply curves due to increases in product group demand are fully captured in this term. The log component of the second term is a variant of the Theil index of dispersion, $ ^{11} $ which reflects the dispersion of the shares of individual products within the product group. If the shares of all products are equal, the term will equal $ \ln N_{U_{grt}} $ , which is increasing in the number of products within product group g supplied by retail firm r. Since the term is multiplied by $ -1/(\sigma_{Ug}-1)\leq0 $ , the product group price index falls as the number of products supplied by the retail firm rises. The product group index also falls as the dispersion of market shares across products within the product group increases.

We estimate $ \sigma_{G} $ using the second term of equation (16) as an instrument for the product price index in equation (15). The moment condition for the instrumental variables is:

$$ \mathbb{E}\left\{\omega_{g r t}\cdot\varDelta^{G,t}\Biggl[\frac{1}{\sigma_{U g}-1}\ln\Biggl(\sum_{u\in U_{g r t}}\frac{S_{u r t}}{\tilde{S}_{U_{g r t}}}\Biggr)\Biggr]\right\}=0. $$

#### 4.2.3 Upper tier of demand

We take the double-difference of the log of the retail firm’s expenditure share (equation (6)) over time and relative to the average share of all retail firms:

$$ \varDelta^{R,t}\mathrm{l n}S_{r t}=-\left(\sigma_{R}-1\right)\varDelta^{R,t}\mathrm{l n}P_{r t}+\omega_{r t}, $$

where the unobserved error term is $ \omega_{rt}=-(\sigma_{R}-1)\Delta^{R,t}\ln\varphi_{rt}.\;\Delta^{R,t} $ is the double-difference operator across retail firms and over time such that $ \Delta^{R,t}\ln S_{rt}=\Delta^{t}\ln S_{rt}-\Delta^{t}\overline{\ln S_{rt}} $ and $ \overline{\ln S_{rt}}=(1/N_{Rt})\sum_{s\in R_{t}}\ln S_{st} $ , while $ \Delta^{t} $ is the first-difference operator over time such that $ \Delta^{t}\ln S_{rt}=\ln S_{rt}-\ln S_{rt-1} $ .
As in the middle tier of demand, we use an IV approach for the estimation of $ \sigma_{R} $ . The retail firm's price index can be written as:

$$ \begin{align*}\varDelta^{R,t}\ln P_{rt}=&-\frac{1}{\sigma_{G}-1}\varDelta^{R,t}\ln\Biggl(\sum_{g\in G_{rt}}\frac{S_{grt}}{\tilde{S}_{Grt}}\Biggr)\\&-\varDelta^{R,t}\Biggl\{\frac{1}{N_{G_{rt}}}\sum_{g\in G_{rt}}\Biggl[\frac{1}{\sigma_{Ug}-1}\ln\Biggl(\sum_{u\in U_{grt}}\frac{S_{urt}}{\tilde{S}_{U_{grt}}}\Biggr)\Biggr]\Biggr\}\\&+\frac{1}{N_{G_{rt}}}\varDelta^{R,t}\ln\prod_{g\in G_{rt}}\Biggl[\widetilde{P}_{Urt}\cdot\big(\prod_{u\in U_{grt}}\varphi_{urt}\big)^{-\frac{1}{N_{Ugrt}}}\Biggr]\\&-\varDelta^{R,t}\ln\big(\prod_{g\in G_{rt}}\varphi_{grt}\big)^{\frac{1}{N_{Grt}}}.\end{align*} $$

We use the sum of the first two terms on the right-hand side of equation (18) as an instrument for the retail firm's price index in equation (17). The moment condition for the instrumental variables is

$$ \mathbb{E}\left\langle\omega_{g r t}\cdot\varDelta^{R,t}\Biggl\{\frac{1}{\sigma_{G}-1}\ln\Biggl(\sum_{g\in G_{r t}}\frac{S_{g r t}}{\tilde{S}_{G r t}}\Biggr)+\frac{1}{N_{G_{r t}}}\sum_{g\in G_{r t}}\Biggl[\frac{1}{\sigma_{U g}-1}\ln\Biggl(\sum_{u\in U_{g r t}}\frac{S_{u r t}}{\tilde{S}_{U_{g r t}}}\Biggr)\Biggr]\Biggr\}\Biggr\rangle=0. $$

### 5. Estimation Results

### 5.1 Estimated Elasticities of Substitution

Table 5 shows that products and product groups supplied by the same firm are imperfect substitutes. At the product level, the estimated elasticity of substitution ranges from 27.56 at the $ 5^{th} $ percentile to 4.76 at the 95th percentile with a median elasticity of 10.57. The elasticities of products below the $ 10^{th} $ percentile are smaller than the firm-level elasticity, reflecting the fact that products supplied by different retail firms are closer substitutes than products supplied by the same retail firm. The

Table 5 : Distribution of estimated elasticities of substitution

Ranked percentile	$ \sigma_{UG} $	$ \sigma_{G} $	$ \sigma_{R} $
1%	47.79
5%	27.56
10%	20.17
25%	15.51
50%	10.57	18.95	20.78
75%	8.24
90%	6.15
95%	4.76
99%	2.86