# Revealing the Spatial Pattern of Weather-Related Road Traffic Crashes in Slovenia
## 2 Materials and Methods
### Modeling the Weather-Related Traffic Crash Footprint  
It is evident that different weather situations create unique spatial patterns of road traffic crashes [12; 13; 14]. We sought to find key explanatory variables and develop an algorithm to predict current spatial patterns in Slovenia and potential shifts in the distribution of road traffic crash hot spots. We operated with the dependent variable total frequency of road traffic crashes (severe injury, death) between 2006 and 2018 per municipality and weather situation. Predictor variables (traffic load, registered personal vehicles, motor vehicles, trailers, trucks, buses, the number of adult persons, regional road length, highway length, MDC, climatic and bioclimatic variables) were first tested for multicollinearity (Spearman's correlation coefficient). Redundant variables were removed (VIF > 3). The remaining predictors were then transformed with either factor or principal component analysis (depending on their distributional properties) in the R statistical environment [35] in order to reduce their number and further operate with uncorrelated information.  
The following explanatory or predictor variables were transformed with factor analysis: traffic loads, registered personal vehicles, motor vehicles, trailers, trucks, buses, the number of adult persons, regional road length, and highway length. Three factors (explaining 88% of variance) were then used in further modeling procedures. The first factor (F1) loaded information about registered vehicle frequency, population (number of adult persons), and highway length. The second factor (F2) provided information about traffic loads and highway length, and the third factor (F3) loaded mainly information about regional road length.  
Principal component analysis was performed on 22 continuous climatic and bioclimatic variables (solar radiation, wind speed, vapor pressure, and 19 bioclimatic variables). All three PCA components (explaining 84% of variability) were then used to calculate the climate heterogeneity index within the SDM Toolbox for ArcGIS [36]. The climate heterogeneity index (CHI) was considered as the fourth predictor variable in the modelling procedure since we wanted to test the importance and contribution of climatic factors. We completed the list of predictor variables with the MDC variable. This economic development indicator is the ratio between the arithmetic mean of standardized values of indicators in the municipality and the arithmetic mean of standardized values of indicators in the country, where the coefficient of average municipal development in the country equals 1.00.  
Finally, two models were calibrated with the dependent variable total frequency of road traffic crashes (severe injury, death) between 2006 and 2018 and the above-mentioned predictors (F1, F2, F3, MDC, and CHI). First, we fitted a geographically weighted regression model (Model Type = Poisson; Spatial Kernel = Adaptive; Bandwidth Searching = Golden Section) with the MGWR 2.2 software (Tempe, AZ, USA) [37] and considered all traffic crashes, regardless of the weather situation. We repeated this procedure for road traffic crashes in rainy, snowy, windy, and foggy conditions. Owing to non-linear relationships between the dependent and independent variables, decision tree models in the R statistical environment were applied in the next step [38; 39]. We divided our sample (212 municipalities) for each weather situation into test (25%) and training data (75%). Based on the functional relationships between the dependent and predictor variables in the test data sample, we predicted the number of road traffic crashes in the training data sample for each weather situation. In order to test model quality, standardized residuals were tested for significant spatial autocorrelation with the Moran's I index. However, additional model quality indicators (explained deviance (ED), mean absolute error (MAE), and root mean square error (RMSE)) were also calculated.