# Bayesian Modeling of Traffic Accident Rates in Poland Based on Weather Conditions
## 2 Materials and Methods  
### Data  
The dataset employed in this study is a comprehensive aggregation of road traffic accidents recorded across Poland between 2015 and 2023, a period selected to ensure data integrity and completeness. Records prior to 2015 exhibited significant data quality issues, including a high incidence of missing values, while 2023 represented the most recent full year of data available during the dataset's development. The resulting dataset contains approximately 250,000 individual accident records, each integrating police-reported accident characteristics with two contextual layers. For each accident, the dataset includes location-specific weather conditions--temperature, relative humidity, hourly precipitation, and 24 h cumulative precipitation--estimated using universal kriging with elevation drift. It also incorporates a suite of county-level socioeconomic indicators, such as population density, road infrastructure metrics, vehicle fleet composition, and historical accident statistics, providing a comprehensive profile for every recorded event. Additionally, the dataset provides reference baselines: daily average weather conditions for each county and yearly socioeconomic indicators for various Polish administrative units (counties, voivodeships, and national aggregates). This dataset was developed in our previous work [45], where traffic accident data were sourced from the Accident and Collision Recording System (SEWIK), the official police-maintained registry of traffic incidents, socioeconomic metrics from Statistics Poland (GUS), Poland's principal government agency for official statistics, and meteorological data from the Institute of Meteorology and Water Management (IMGW), the state service for meteorological and hydrological monitoring. The creation of this dataset involved extensive preprocessing to ensure its quality and analytical robustness. Key steps included the standardization of administrative unit names to resolve inconsistencies, the removal of physically implausible meteorological outliers, and the clipping of precipitation values below the minimum detectable threshold. As a result of these procedures, the data utilized in this study are clean, requiring no further imputation. Detailed preprocessing methodology can be found in the referenced work. The multidimensional structure of this dataset enables modeling across various temporal and geographic scales. Socioeconomic data facilitates detailed modeling of accident location patterns, while meteorological parameters allow for fine-grained temporal analysis. Given these capabilities, we focus on two distinct modeling challenges with different scale considerations:  
* Modeling yearly accident counts at the county level
* Modeling weekly accident counts at the national level  
For our analysis, we examined the period from 2020 to 2023, utilizing weather parameters (temperature, humidity, and precipitation) based on data from IMGW and three socioeconomic indicators (population density, passenger car registrations, and road density) reported by GUS. The selection of these variables is directly informed by established road safety literature and the preliminary findings presented in our foundational work [45]. Weather parameters such as temperature, humidity, and precipitation were chosen for their well-documented effects on driver behavior and road surface conditions. Our previous analysis confirmed these relationships, revealing a consistent positive correlation between temperature and accident frequency (correlation coefficient of 0.09) and a notable negative correlation for humidity (\(-0.10\)). The selected socioeconomic indicators serve as robust proxies for traffic exposure and infrastructure characteristics. Specifically, population density and passenger car registrations were included due to their strong positive correlation with total accident counts (0.45 and 0.82, respectively), while road density provides a crucial measure of infrastructure development, showing a meaningful correlation (0.31).