[5] [6] ii cc(ii) ii 2ii ii cc(ii) cc(ii) ii 3ii where DllRR(D denotes the average population density of grid cell DD ) = αα+ θθ + ββ ln(dd ) + εε _i_ , a city-specific fixed effect for city _c_ where cell _i_ is, and the distance from the centroid of cell _i_ to the city’s barycenter of all its cells weighted ii cc(ii) by their populations (i.e., the center of the city’s population “mass”).DD θθ<sup>30</sup> The difference between equations ii [5] and [6] is that while the former constrains the population density gradient to be the same for all cities dd within a country, the latter allows it to differ across cities within a country. For any given country, the from the estimation of equation [4] measures how much of the variation in population density across the grid cells that belong to its cities can be explained by differences in population density _between_ its cities. Correspondingly, RR<sup>2</sup> ) measures the variation that is attributable to cell level variation _within_ cities. As can be seen from table 6, both the mean and median across all SSA countries are 0.07. Hence, on average for SSA countries, variation across cities only accounts for 7 percent of the (1 −RR<sup>2</sup> variation in population density across the cells that belong to those cities, implying that 93 percent of the RR<sup>2</sup> variation occurs within cities. Even at the 90<sup>th</sup> percentile of the distribution of estimated values, only 12 percent of the variation in population density across cells is explained by the variation across cities. RR<sup>2</sup>

||**Table 6: Distributio**|**n of withi**|**n-city popu**<br>**Std**|**lation den**|**sity gradie**|**nts over 4**|**3 SSA cou**|**ntries**|
|---|---|---|---|---|---|---|---|---|
|**Row**|<br>|**Mean**|**.**<br>**Error**|**P10**|**P25**|**P50**|**P75**|**P90**|
|1|R<sup>2</sup>pop.<br>[Ree.[4]<br>2<br>, Ree.[5]<br>2<br>, Ree.[6]<br>2<br>]|0.07/<br>0.16/0.20|0.03/<br>0.09/0.09|0.03/<br>0.05/0.08|0.04/<br>0.08/0.13|0.07/<br>0.13/0.19|0.10/<br>0.24/0.27|0.12/<br>0.28/0.32|
|2|<br> <br>Pop. grad. sh.<0|0.81|0.18|0.54|0.74|0.88|0.93|0.95|
|3|<br> <br>Pop. grad. sh. ns|0.18|0.18|0.04|0.07|0.11|0.24|0.44|
|4|Pop. grad. sh.>0|0.01|0.02|0|0|0.01|0.02|0.03|
|5|Pop. grad. Av.|-0.89|0.5|-1.53|-1.17|-0.83|-0.49|-0.26|
|6|Pop. grad. P10|-2.96|0.79|-3.91|-3.63|-2.84|-2.39|-2.06|
|7|Pop. grad. P25|-2.4|0.72|-3.23|-2.98|-2.36|-1.81|-1.6|
|8|Pop. grad. P50|-1.73|0.64|-2.42|-2.11|-1.73|-1.28|-0.97|
|9|Pop. grad. P75|-1.11|0.48|-1.67|-1.44|-1.09|-0.79|-0.45|
|10|Pop. grad. P90|-0.61|0.38|-1.03|-0.8|-0.62|-0.41|-0.22|

**Notes:** Row 1: R<sup>2</sup> for the estimation of equations [4] – [6] for population density. _Pop. grad. sh. <0:_ Share of cities with significant (10% threshold) negative population density gradient. _Pop. grad. sh. ns:_ Share of cities with non-significant (10% threshold) population density gradient. _Pop. grad. sh. >0:_ Share of cities with significant (10% threshold) positive population density gradient. _Pop. grad. Av.:_ average (over all cities) population density gradient (when significantly (10% threshold) different from zero). _Pop. grad. PXX:_ Population density gradient for the city at the XX<sup>th</sup> centile for the gradient value. Statistics are computed over the cross-section of 43 SSA countries, Comoros, Madagascar, Seychelles and São Tomé Príncipe being excluded for the within-city statistics given their to low number of cities or of centers in these cities  PX corresponds to the X<sup>th</sup> percentile of <u>the distribution.</u>

By adding ) to equation [4], equation [5] allows a grid cell’s average population density not only to vary across a country’s cities, but also with the distance between that cell and the barycenter of the city of ii which it is a part. As can be seen, the mean ln (dd of 0.16 from the estimation of equation [5] for each country is more than double the mean of 0.07 from the estimation of equation [4] for each country.<sup>31</sup> Hence, distance to a city’s barycenter is an important source of population density variation at the grid cell level. RR<sup>2</sup> The importance of distance further increases when we allow distance gradients to vary across a country’s RR<sup>2</sup> cities, as in equation [6]. This follows from the fact that both the mean and median values from the estimation of equation [6] are greater than the corresponding values from the estimation of equation [5]. At the 90<sup>th</sup> percentile across countries, the city-specific fixed effects and distance to a city’s barycenter can, RR<sup>2</sup> when allowing for heterogeneity in distance gradients across cities, account for almost a third of the RR<sup>2</sup> variation in population density across individual grid cells. This increase in explanatory power is to be

> 30 The concept of a city’s barycenter should not be confused with the concept of city centers that is discussed in Section 5.3 below. Hence, while a city’s barycenter is unique, a city may have one or more centers, and, under special circumstances, it may even have no statistically identifiable center at all.

> circumstances, it may even have no statistically identifiable center at all. 31 Given that equations [4]-[6] are estimated at the grid cell level for each country, each is based on an extremely large number of observations. As such, whether the is adjusted or not for the number of degrees of freedom makes no difference to the discussion. RR<sup>2</sup> 17