product and service quality of other products does not affect the quality ratio of product u. The quality ratio is purely determined by the difference in service quality related to product u.

Similarly, the quality ratio of product group g at retail firm r and $ \hat{r} $ is given by

$$ \frac{\varphi_{g r t}}{\varphi_{g\acute{r}t}}=\frac{P_{\bar{u}\acute{g}r t}/P_{\bar{u}\bar{g}\acute{r}t}}{P_{\bar{u}\acute{g}\acute{r}t}/P_{\bar{u}\bar{g}\acute{r}t}}\cdot\frac{\left(S_{\bar{u}\acute{g}r t}\frac{1}{\sigma_{U g}-1}S_{g r t}\frac{1}{\sigma_{G}-1}\right)\left/\left(S_{\bar{u}\acute{g}r t}\frac{1}{\sigma_{U\bar{g}}-1}S_{\bar{g}r t}\frac{1}{\sigma_{G}-1}\right)\right.}{\left(S_{\bar{u}\acute{g}\acute{r}t}\frac{1}{\sigma_{U g}-1}S_{g\acute{r}t}\frac{1}{\sigma_{G}-1}\right)\left/\left(S_{\bar{u}\acute{g}\acute{r}t}\frac{1}{\sigma_{U\bar{g}}-1}S_{\bar{g}\acute{r}t}\frac{1}{\sigma_{G}-1}\right)\right.}. $$

If, for simplicity, we assume for the moment that $ \sigma_{G}=\sigma_{Ug}=\sigma_{U\bar{g}}=2 $ , we have

$$ \frac{\varphi_{g r t}}{\varphi_{g\prime r}}=\frac{P_{\bar{u}\bar{g}r t}/P_{\bar{u}\bar{g}r t}}{P_{\bar{u}\bar{g}\prime r}/P_{\bar{u}\bar{g}\prime r}}\cdot\frac{(S_{\bar{u}\bar{g}r t}S_{g r t})/(S_{\bar{u}\bar{g}\prime r}S_{\bar{g}\prime r})}{(S_{\bar{u}\bar{g}\prime r}S_{g\prime r})/(S_{\bar{u}\bar{g}\prime r}S_{\bar{g}\prime r})}, $$

which is determined by the ratio of the relative prices of product $ \bar{u} $ measured by the price of the benchmark product $ \bar{u} $ of the benchmark group $ \bar{g} $ at each firm (the ratio of $ P_{\bar{u}grt}/P_{\bar{u}grt} $ and $ P_{\bar{u}grt}/P_{\bar{u}grt} $ ) and the ratio of relative sales measured by the sales of the benchmark product $ \bar{u} $ of the benchmark group $ \bar{g} $ at each firm (the ratio of $ (S_{\bar{u}grt}S_{grt})/(S_{\bar{u}grt}S_{\bar{g}rt}) $ and $ (S_{\bar{u}grt}S_{grt})/(S_{\bar{u}grt}S_{\bar{g}rt}}) $ ).

Finally, the quality ratio of retail firm r and $ \dot{r} $ is given by

$$ \frac{\varphi_{r t}}{\varphi_{r t}^{\prime}}=\frac{P_{\bar{u}r t}(S_{\bar{u}r t})^{\frac{1}{\sigma_{U g}-1}}(S_{\bar{g}r t})^{\frac{1}{\sigma_{G}-1}}(S_{r t})^{\frac{1}{\sigma_{R}-1}}}{P_{\bar{u}\prime r t}(S_{\bar{u}\prime r t})^{\frac{1}{\sigma_{U g}-1}}(S_{\bar{g}\prime r t})^{\frac{1}{\sigma_{G}-1}}(S_{\prime r t})^{\frac{1}{\sigma_{R}-1}}}. $$

If we again assume $ \sigma_{G}=\sigma_{Ug}=\sigma_{U\bar{g}}=2 $ for simplicity, we have

$$ \frac{\varphi_{rt}}{\varphi_{rt}^{\prime}}=\frac{P_{\bar{u}rt}S_{\bar{u}rt}S_{\bar{g}rt}S_{rt}}{P_{\bar{u}\prime rt}S_{\bar{u}\prime rt}S_{\bar{g}\prime rt}S_{\prime rt}}=\frac{P_{\bar{u}rt}E_{\bar{u}rt}}{P_{\bar{u}\prime rt}E_{\bar{u}\prime rt}}. $$

Since the barcode-level product and service quality of product $ \bar{u} $ are the same across retail firms, this expression captures the difference in firm-level quality that homogeneously affects all products within the firm. For example, if retail firm r sells more of product $ \bar{u} $ than retail firm $ \dot{r} $ ( $ E_{\bar{u}r t}>E_{\bar{u}\dot{r}t} $ ) even though the prices are the same or even higher ( $ P_{\bar{u}r t}\geq P_{\bar{u}\dot{r}t} $ ), we assume that firm r's firm-level quality is greater than that of firm $ \dot{r} $ .

### 3.2 The retail firm's problem

#### 3.2.1 Technology

We allow the costs of supplying products to the market to vary across barcodes and retail firms. Retail firm r at time t has a variable cost for supplying product u in product group g of