A gridded establishment dataset as a proxy for economic activity in China

Measuring the geographical distribution of economic activity plays a key role in scientific research and policymaking. However, previous studies and data on economic activity either have a coarse spatial resolution or cover a limited time span, and the high-resolution characteristics of socioeconomic dynamics are largely unknown. Here, we construct a dataset on the economic activity of mainland China, the gridded establishment dataset (GED), which measures the volume of establishments at a 0.01° latitude by 0.01° longitude scale. Specifically, our dataset captures the geographically based opening and closing of approximately 25.5 million firms that registered in mainland China over the period 2005–2015. The characteristics of fine granularity and long-term observability give the GED a high application value. The dataset not only allows us to quantify the spatiotemporal patterns of the establishments, urban vibrancy, and socioeconomic activity, but also helps us uncover the fundamental principles underlying the dynamics of industrial and economic development.

activity measurement 4,[19][20][21] . However, there are still some limitations in the NTL data. First, it mainly reflects electricity-powered illumination at night 4 , which does not necessarily match real socioeconomic activity. Second, because of the saturation effect, NTL can easily reach the upper limit of luminance value within cities, making it difficult to capture the variation of economic activity inside cities. Third, for each grid cell, there is only the brightness value provided by NTL; however, development modes of two regions with the same luminance value (e.g., a manufacturing park and a high-tech park) may be very different. NTL cannot capture this potentially heterogeneous development. A comprehensive comparison between NTL and micro-level socioeconomic variables can be found in ref. 4 . In addition to NTL data, mobile phone data and social media data have also been used in recent studies to investigate economic activity 14,22,23 . Although generally regarded as effective data sources, three main reasons limit their wide application in the estimation of economic activity. First, access to such data is limited. Due to privacy issues, operators or web platforms are reluctant to release their data. Second, mobile phone data or social media data mainly measure users' online social activity, which is not directly related to economic activity. Third, there are often multiple platforms in a region, so that the information reflected in mobile phone data or social media data usually represent the users covered by a particular platform, i.e., the data may not be representative 24,25 .
In this paper, using approximately 25.5 million firm registration records, we construct a geographically based dataset -the gridded establishment dataset (GED) -on the economic activity of mainland China. To the best of our knowledge, this is the first geocoded establishment dataset covering mainland China. An important advantage of this dataset is that it simultaneously provides high spatial resolution (0.01° latitude by 0.01° longitude, approximately 1.1 km × 1.1 km at the equator) and long-duration observations (2005-2015, 11 years). For each  www.nature.com/scientificdata www.nature.com/scientificdata/ grid cell, we also provide the number of establishments by industry, which allows us to analyze the heterogeneous development trajectories of a region. The workflow to construct the dataset is shown in Fig. 1 and detailed in the Methods section.
To validate this dataset, we analyze the accuracy of the geocoding process and compare the GED with several socioeconomic indicators and NTL data at the city level. The results show that the GED can effectively reflect socioeconomic activity and achieves a better performance than that of the NTL. The characteristics of fine granularity and long-term observability give this dataset high application values. It not only can allow researchers and policymakers to quantify the spatiotemporal patterns of economic activity but also can help us uncover the fundamental principles underlying the dynamics of industrial development. Additionally, having a greater availability of these granular data can advance the potential of machine learning models for urban studies. For example, the GED can serve as tags for satellite/streetview imagery to build machine learning models to predict socioeconomic dynamics 26 .
Although the GED is a major step towards measuring the geographical distribution of economic activity in China, we should note that it also has several limitations. First, we only have the registered addresses of firms, which may not be the same as the operational addresses. Especially for some industrial parks, due to some location-based policies, e.g. tax subsidies, some firms may register within these industrial parks but operate elsewhere. Second, because of the change in place names, there may be errors in the geocoding process for historical addresses. Therefore, we limit the starting date of the dataset to 2005, when Amap and Baidu, the location-based service providers we use to geocode the address, began to provide online map services in China. Third, business size (e.g., number of employees or revenue-related information) is undocumented in the original data; thus, we can only use establishment counts to represent economic activity.

Methods
Data source and preprocessing. Each newly established firm in mainland China needs to register at the local Administration for Industry and Commerce (AIC) by providing detailed information, such as firm name, address, industry classification, and stockholders. After approval, the relevant information is publicized on the Internet, and everyone can retrieve these data from an online system named the National Enterprise Credit Information Publicity System (NECIPS, http://www.gsxt.gov.cn/index.html). Our original data are collected from this system via web scraping. Specifically, we collect the names of firm that were established between 2005 and 2015 from Tianyancha 27 , a website that provides firm-related information in China. By querying firm names, we then obtain the detail page of each firm. Finally, we collect 83.7 million registration records.
To reduce potential noise in the original data, we perform preprocessing as follows: 1) We drop the record of "individual industrial and commercial household" (57.8 million records), a business type whose scale is generally small -fewer than seven employees by law. Another reason for this filter is that the registered addresses of "individual industrial and commercial households" are often at village or township level, and there is no clear street address to perform geocoding. 2) According to the operational status in the year (2018) of data collection, we classify firms into three categories: existing, cancelled, and other, see the preprocessing code for details. Here, existing means that the firm has been operating from the time of registration until (at least) 2018; cancelled means that the firm was closed at a certain time between the registration year and 2018; other represents the remaining status, such as unknown status and moving out. Note that this classification does not affect the number of establishments in the statistics every year, but only adds a dimension to evaluate the operation status of establishments.
3) According to the industry classification, we further label establishments with tags of primary, secondary, and tertiary sectors (Table 1). After data preprocessing, there are a total of 25,545,850 establishments left. Figure 2a show the number of newly established firms by industry each year. To demonstrate the representativeness of this dataset, we further collect the official statistics based on a report published by the State Administration for Industry and Commerce 28   www.nature.com/scientificdata www.nature.com/scientificdata/ (Fig. 2b). The coverage ratio greater than 100% is probably because the government has subtracted the firms that were cancelled during the registration year when counting the yearly establishments. Overall, our results are identical with those of official statistics (Fig. 2b).
Geocoding. Geocoding is the key step for building a geolocated dataset 29 . To obtain high-quality geocoding results, it is important to know the city to which the firm address belongs. The city and address can then be passed into the online map application program interface (API) to ensure that the search results belong to the input city, which can significantly reduce the problem of ambiguity in place names. In other words, cities may have streets or buildings with the same name, and only querying the street name may return multiple coordinates, for example, one in city A and one in city B, making it difficult to match the address with the right coordinate. We notice that a considerable proportion of the city data is missing or inaccurate in the NECIPS database. To solve the missing value issue and obtain the coordinates of each firm, we have taken the following steps: • 1) We build a city list containing the full name and short name of all prefecture-level cities (including dijishi, diqu, meng, and autonomous prefecture) and counties (including shixiaqu, xian, qi, and autonomous county) in mainland China, see ref. 30 for details on the administrative divisions of China. • 2) We inspect the city list, if a city name (full name) appears in the address of a registration record, the firm is then classified into this city. For example, the address 'Beijing City, Haidian District, Zhongguancun Street' belongs to Beijing City. • 3) For cities where the full name cannot be found, we check whether the short name of the city appears in the address. For example, 'Shanghai, Pudong District, and Haiyang Building' belong to Shanghai City because 'Shanghai' is a short name of 'Shanghai City. ' • 4) For cities that can not be matched to any cities, we then inspect the county/district names. For example, the address 'Haidian District, Zhongguancun Street' belongs to Beijing City, as 'Haidian' is a district of Beijing. • 5) If the address field does not contain any description of the city/county/district name, we try to extract the city information from other fields such as the registration authority. In the end, the corresponding cities or countries could not be found for approximately 3% of the total records. The step of extracting city names can be processed automatically by some Python packages, e.g., the 'cpca' package 31 . • 6) After having the city and address information, we geocode them with AMap API 32 , and obtain the coordinate information (longitude, latitude). Because the registered addresses will be checked by AIC, it is unlikely that there would be typo issues. AMap also automatically handles typo issues according to the API document 32 . • 7) Finally, we convert all geocoded coordinates from the GCJ02 projection, a special projection system in China 33 , into the world geodetic system 1984 (WGS84) projection, and then aggregate the coordinates according to a 0.01° latitude by 0.01° longitude grid. www.nature.com/scientificdata www.nature.com/scientificdata/ As shown in Fig. 2b, we find that the distributions of the grid-cell values are well fitted by a log-normal function, which is in line with most socioeconomic characteristics 34 . Meanwhile, we plot the map of newly established firms in 2015 (Fig. 3). As seen from the map, our dataset clearly shows the geographic pattern of economic activity in China -the vast majority of economic activity is concentrated in the eastern coastal areas, especially the three megacity clusters: Beijing-Tianjin-Hebei, the Yangtze River Delta, and the Pearl River Delta. Unlike the NTL data, the establishment dataset does not have the saturation effect, so it can easily capture variations within cities (Fig. 3b,c).

Data Records
Data are available at the figshare repository 35 . The repository contains four data files, and the variable descriptions of the main file ('GED_2005-2015_v2.csv') are reported in Table 2. Each row of the file represents the record of one grid cell, including the centroid longitude and latitude, year of the record, total number of establishments, number of establishments in different operational statuses, and number of establishments in different industries ( Table 2). It should be noted that for a cancelled firm, the date variable here represents the year when the firm was registered, not the year when it was cancelled.
To reduce the file size, for a given year if a grid cell does not have any registration record, this grid cell is not included in the dataset. For ease of use, we also link the coordinates of cells with the county, city and province information. The basic statistical summary at the province level is shown in Table 3. Guangdong, Jiangsu, Shangdong, Zhejiang and Shanghai rank among the top five in terms of number of establishments. The reason why Shandong ranks high is because of its large population, and the other four provinces are recognized as the regions with the strongest entrepreneurial spirit in China.
We also provide three-year -2005, 2010, and 2015 -unaggregated data to facilitate researchers to conduct research on different scales. For the data description of the unaggregated data, see the 'read-me' file under the figshare repository path.

technical Validation
To validate the dataset, we analyze the accuracy of geocoding and the correlation between our dataset and other socioeconomic indicators.

Validation of geocoding.
According to the city size and geographical location, we select three representative cities and randomly sample 10,000 records for analysis. The three cities are Beijing (large city), Changsha (medium-sized city), and Anshan (small city). For geocoding accuracy, we use two methods to evaluate. The first is the spatial resolution returned by the Amap API. This is the geographical level that the map can match according to the input address. The finer the geographical resolution, the higher the accuracy may be. As shown in Table 4, the finest match is to the street number, followed by the point of interest (POI). Any address that can match these two levels is generally of high accuracy, and we find that more addresses are matched at these two levels in large cities than in medium and small cities: 88% of Beijing compared with 77% of Changsha and 48% of Anshan. Moreover, if we consider two more levels, to the level of villages and towns, then the geocoding accuracy of these three cities is 96%, 95% and 84%, respectively.  www.nature.com/scientificdata www.nature.com/scientificdata/ Another verification method is to use the 'confidence indicator' returned by Baidu Maps. (Amap and Google Maps do not provide this measure, but considering Amap and Baidu Maps provide similar services in China, therefore we use the 'confidence indicator' obtained from Baidu Maps as a benchmark to evaluate the quality of the address attribute of firms.) According to the document of Baidu Map 36 , geocoding confidence ≥50 means the absolute geocoding error is less than 1000 m. We use Baidu Maps to re-geocode these sampled addresses, the results show that the proportions of coordinate errors less than 1000 m (i.e. confidence ≥50) in the three cities are 93.1%, 92.2% and 74.1%, respectively, implying that the accuracy of the geocoding services is significantly higher in large cities than in small cities.

Validation with city socioeconomic indicators.
To further justify the validity of the data, we aggregate the number of newly established firms at the city level, and compare it with the city's socioeconomic indicators: GDP, fiscal revenue, and employment. These indicators are collected from the city statistical yearbook, and some cities are excluded due to a lack of statistical data from the yearbook. We present the results of two fitting models  Table 3. Statistical summary of the establishments (2005)(2006)(2007)(2008)(2009)(2010)(2011)(2012)(2013)(2014)(2015). N total is the total number of establishments within the province. Min, Max, Mean, and SD (standard deviation) are the statistical indicators at the cell level, i.e., each cell is one observation.  www.nature.com/scientificdata www.nature.com/scientificdata/ in Fig. 4. One is a linear regression between the total number of establishments and the variables of interest y, denoted as Model 1: The second model decomposes the number of establishments into three sectors, i.e., the primary, secondary, and tertiary sectors. Model 2 is as follows: To make a comparison with the nighttime light data, we also collect the Visible Infrared Imaging Radiometer Suite (VIIRS) NTL data for 2015 (available through www.ngdc.noaa.gov/eog/viirs). We use the annual 'vcm-orm-ntl' average radiance layer, which has undergone an outlier removal process (exclusion of data impacted by stray light, lightning, cloud cover, etc.). Similar to the establishment data, we aggregate the values of nighttime light data at the city level. To make the results comparable, we used the 2015 data of each dataset for comparison. Figure 4 shows the fitting results (adjusted R 2 ) of GDP, fiscal revenue, and employment at the city level. In general, both our data and the nighttime light data perform well in estimating these socioeconomic variables, with adjusted R 2 values over 0.70 in all cases. However, the accuracy of the establishment data is better than that of the the nighttime light data in predicting all three variables (Model 1), especially for fiscal revenue (0.817 vs. 0.710) and employment (0.761 vs. 0.708), and decomposing establishments into three sectors, i.e., Model 2, further improves the adjusted R 2 (Fig. 4a-c). Additionally, we add log 10 NTL in Eqs. (1) and (2) to test how much additional variance can be explained by the combined model (Fig. 4d-f). Results demonstrate that the combined version of Eq. (2) achieves the highest predicting accuracy, implying that the establishment data and NTL data respectively capture some elements of the socioeconomic indicators, thus they can be jointly used in practice.

Spatial resolution
Finally, we validate our dataset by linking it with a granular population dataset to verify the scaling law of cities. As demonstrated in numerous studies 37,38 , urban socioeconomic activity Y scales with population P in a simple power-law manner: Y∼P α , where α is called the scaling exponent (or the elasticity in the term of economics). To test the power-law relationship within cities, we collect a mobile phone estimated population dataset from ref. 39 . We match the population with the establishment data under the same spatial resolution (0.01° latitude by 0.01° longitude, see Fig. 5), and then run a simple regression to estimate the scaling coefficient α of Beijing. According to the assumption of the scaling theory, we constrain the analysis within the urbanized area by setting a population density threshold of 1,000 people/km 2 , and drop cells with population density lower than this threshold. Result shows that the power-law relationship between population and establishments holds well within cities, and the scaling exponent α = 1.16 is greater than 1, which is very close to the theoretical numbers derived from different models 40 .   (d-f) Similar to (a-c) but replacing establishments with the nighttime light data. We also add log 10 NTL in Eqs. (1) and (2), and present the regression results in (d-f).

Usage Notes
The GED can be used in geographic information systems (GIS), such as ArcGIS and QGIS, as well as statistical software, such as Python, R, MATLAB, and Stata. In GIS software, the dataset can be imported as a vector layer or a raster layer. To match with other geographical datasets, such as industrial park boundaries 41 or water/air quality monitoring records 42 , users can apply the spatial join function in GIS software by joining attributes from GED to another data based on the spatial relationship 43 . For example, we can draw a buffer for each industrial park, and then extract the grid cells and the corresponding establishments that fall within this buffer. If the resolution of the GED is inconsistent with other data sources in use, some resampling methods used in remote sensing areas could also be applied to this dataset 44 .
Additionally, the county/city/province name provided in this dataset is based on the administrative boundary of 2019. Therefore, if the GED is matched with other statistical data by couty/city/province name, the impact of changes in the name (and the corresponding spatial range) should be considered. It's also notable that the grid cell index of GED is under WGS84 coordinates. Thus, the spherical area of grid cells in different regions is different (approximately 1.1 km × 1.1 km at the equator and 0.85 km × 1.1 km at Beijing).
Finally, as mentioned in the introduction section, due to some location-based policies, there will be a large number of registered enterprises in some specific areas, such as the Shanghai Free Trade Zone. The data points on the far right of Fig. 2c indicate that there are more than 10,000 establishments in each of these grid cells. Such spatial 'outliers' would have a certain impact on some micro-scale analyses. To address this issue, we suggest taking an upper limit on the value in each cell or using a logarithmic transformation of the data when performing micro-scale analyses.

Code availability
The preprocess script, validation dataset and the R code that performs the statistical analysis are available through https://github.com/quanturban/firm.