Table of Contents

1 Code and reproducibility

The code to reproduce the paper and its analyses, as well as this supplement, are found at https://github.com/the-Hull/berlin.trees/, with a permanently archived version at https://doi.org/10.5281/zenodo.7217031.
The project relies on the workflow management tool drake, where all analyses steps are maintained within the file berlin.trees/R/plan.R, with functions representing actions/steps in berlin.trees/R/functions.R. The code downloads most necessary files to execute the analyses. However, some files were too large for tracking with version control (i.e., git on GitHub); thus, should any issues arise with executing the code, please contact the corresponding author.

Further information on drake is available at:
- William Michael Landau, (2018). The drake R package: a pipeline toolkit for reproducibility and high-performance computing. Journal of Open Source Software, 3(21), 550, https://doi.org/10.21105/joss.00550

2 Data quality control for street tree inventory

Manual data processing for quality control was done with a bespoke software datacleanr by (Hurley et al., 2022), where obvious outliers or clearly interpolated data were removed. The latter was deemed necessary, as several observations in multiple city districts were derived by linear relationships (i.e., straight-line), which do not capture the ontogenic growth dynamics of trees, and leave no variation related to variables other than age. All of these operations were recorded, and can be viewed in the repository https://github.com/the-Hull/berlin.trees/ and reproduced via the supplementary code:

Manual data inspection and cleaning with the R package `datacleanr`. This example for the genus *Tilia* in the district Spandau clearly shows linearly interpolated age-diameter observations. These were manually removed with utmost diligence to retain non-interpolated data. Note, that the supplementary code includes files to view and reproduce the results of manual cleaning in *analysis/data/raw_data/tree_splits/*.

Figure 2.1: Manual data inspection and cleaning with the R package datacleanr. This example for the genus Tilia in the district Spandau clearly shows linearly interpolated age-diameter observations. These were manually removed with utmost diligence to retain non-interpolated data. Note, that the supplementary code includes files to view and reproduce the results of manual cleaning in analysis/data/raw_data/tree_splits/.

Lastly, observations with unlikely diameter-age combinations were identified via the residuals of a generalized linear model between diameter and age with a Gamma log-link distribution: if individual residuals exceeded seven times the median absolute deviation of all residuals, they were removed. The median absolute deviation (MAD) is comparable to the inter-quartile range, yet more robust to outliers:

\[\begin{equation} MAD = median(\|X_i - median(X)\|) \tag{2.1} \end{equation}\]

Observations with unlikely diameter-age combinations ($dbh_{cm}~vs.~STANDALTER$) were identified via the residuals of a generalized linear model between diameter and age with a Gamma log-link distribution for every species included in the study. Where individual residuals exceeded seven times the median absolute deviation of all residuals, they were removed. The line is the fitted model, and colors represent retained or removed observations (see legend). See main text (Section Street Trees) for further explanation.

Figure 2.2: Observations with unlikely diameter-age combinations (\(dbh_{cm}~vs.~STANDALTER\)) were identified via the residuals of a generalized linear model between diameter and age with a Gamma log-link distribution for every species included in the study. Where individual residuals exceeded seven times the median absolute deviation of all residuals, they were removed. The line is the fitted model, and colors represent retained or removed observations (see legend). See main text (Section Street Trees) for further explanation.

3 Spatial auto-correlation

Exploratory analyses of (initial) model residuals showed spatial auto-correlation was present in the structure of the inventory data (identified by correlation of x and y coordinates with residuals). Note that this was expected given that trees planted on the same road (and/or neighborhood, district) may share several features, such as planting time, species, adjacent urban fabric. Thus, we included model features (i.e., dependent variables) in the model formulation to account for spatial auto-correlation. This was achieved with isometric smoothing splines with basis derived from both x and y co-ordinates (i.e., interaction terms in the generalized additive model). We used Morans’ I to calcualte spatial dependency with the function Moran.I() from the R package ape.

\[ I = \frac{n}{S_0} \cdot \frac{\sum_{i=1}^{n} \sum_{j=1}^{n} w_{ij}(y_{i} - \bar{y})(y_{j} - \bar{y})} { \sum_{i=1}^{n} (y_{i} - \bar{y})^2} \] where \(y_{i}\) are individual observations, \(w_{ij}\) are distance weights, \(n\) are the totall number of observations, and \(S_{0} = \sum_{i=1}^{n} \cdot \sum_{j=1}^{n} w_{ij}\).

Details on ape can be found in:

Due to computational limitations, we split the data set into several groups using a spatial grid from the Berlin authorities, based on \(2 \cdot 2~km\) cells, found at:
- https://fbinter.stadt-berlin.de/fb/atom//DOP/Blattschnitt2x2km.gif,

with further details at:
- https://fbinter.stadt-berlin.de/fb/berlin/service_intern.jsp?id=a_luftbild2010_cir@senstadt&type=FEED (accessed at 2022-09-29),

with the resulting splits below:

Grid for splitting observations into discrete groups. Regions are based on $2 \cdot 2~km$ grid cells and grouped based on Berlin's data acquisition scheme for aerial images

Figure 3.1: Grid for splitting observations into discrete groups. Regions are based on \(2 \cdot 2~km\) grid cells and grouped based on Berlin’s data acquisition scheme for aerial images

We observed a considerable reduction of Moran’s I (i.e., spatial auto-correlation) by including spatial terms in the model structure (i.e., x and y coordinates). Given the large sample sizes available for this study we considered this approach (i.e., spatial terms) satisfactory to ensure the inference of model coefficients was not violated due to dependence of residuals.

Comparison of Moran's I with and without spatial terms included in the model structure as dependent variable (bar color) between two model structures (additive on left, and interaction structures for temperature on the right).

Figure 3.2: Comparison of Moran’s I with and without spatial terms included in the model structure as dependent variable (bar color) between two model structures (additive on left, and interaction structures for temperature on the right).

References

Hurley, A.G., Peters, R.L., Pappas, C., Steger, D.N., Heinrich, I., 2022. Addressing the need for interactive, efficient, and reproducible data processing in ecology with the datacleanr R package. PLOS ONE 17, e0268426. https://doi.org/10.1371/journal.pone.0268426