Application of the Apriori Algorithm for Trafﬁc Crash Analysis in Thailand

: Accidents pose signiﬁcant obstacles to economic progress and quality of life, especially in developing countries. Thailand faces such challenges and this research seeks to assess the frequency and most common causes of road accidents that lead to fatalities. This study employed the Apriori algorithm to examine the interrelationships among factors contributing to accidents in order to inform policymaking for reducing accident rates, minimizing economic and human losses, and enhancing the effectiveness of the healthcare system. By analyzing road accident data from 2015 to 2020 in Thailand (167,820 accidents causing THB 1.13 billion in damages), this article speciﬁcally focuses on the drivers responsible for fatal highway accidents. The ﬁndings reveal several interconnected variables that heighten the likelihood of fatalities, such as male gender, exceeding speed limits, riding a motorbike, traveling on straight roads, encountering dry surface conditions, and clear weather. An association rule analysis underscores the increased risk of injury or death in trafﬁc accidents.


Introduction
Road traffic accidents are a worldwide issue that has been troubling civilization for a long time. Specifically, road accidents in Southeast Asia and Africa have been continuously increasing for at least the last 10 years (2008-2018) [1]. According to WHO data, in 2018, Thailand was ranked number one for road accidents in Asia and number nine in the world. An average of 32.7 Thais per 100,000 die in road accidents every year [1]. Not only has this caused an economic upheaval but it has impacted the country's public health system. Road accidents have also caused the country's limited resources to be used in ways that are harmful to its progress. They negatively impact the country's human resources, resulting in the death or disability of its residents.
In Thailand, examples of road safety policies include law enforcement (e.g., for exceeding speed limits or the consumption of alcohol), road safety programs in educational institutions, the development of advertising media, an increase in the number of training hours required to obtain new drivers' licenses and their renewals, engineering solutions for road safety audits, and research funding. To establish these regulations, predicted data on the number of accidents were used to determine operational budgets [2]. However, the average number of roadway fatalities in Thailand from 2015 to 2020 remained consistent at 32-35% for the sixth year in a row, as shown in Figure 1. The existing policy appears to be ineffective. Learning from every element recorded in a big dataset and starting to predict and minimize accidents before they occur might be the way out. Previous studies have utilized machine learning algorithms to predict injury severity. Some focused on independent derstand which factors interfere with each other or any linkage between them that increases the chances of fatality. According to the Swiss cheese theory [3], if all of the holes (factors) are aligned by chance, an accident will happen and result in death. In contrast, the risk may be decreased by controlling the primary element that has the strongest influence on fatality. For example, a researcher noted that accidents are typically caused by a combination of circumstances rather than by one or two factors. In addition, if the elements were combined, how likely is it that someone would die? However, what happens if a risk factor is reduced? This is why forecasts have appeared in order to simulate situations. However, predicting an accident event is also essential for establishing road safety, budgeting, staffing, and policy planning.  Against the backdrop of Thailand's road safety policies and the persistent fatality rate, several pivotal research questions have emerged. Initially, the efficacy of the current policies comes into focus. Can big data analysis enhance road safety predictions? Moreover, the role of machine learning algorithms in accounting for concurrent elements contributing to fatalities warrants exploration. How can the alignment of risk factors be effectively managed? Additionally, what are the implications of accurate accident prediction for road safety planning and policy formulation? Lastly, the role of comprehensive factor analysis in deepening insights into accidents and guiding interventions merits consideration. These inquiries collectively illuminate policy effectiveness, the potential of predictive analytics, the intricacies of accident causation, and avenues for refining road safety strategies.
However, these studies did not consider the conditions of the events for the drivers who were killed. The conditions being discussed included the type of roadway; vehicle type; external factors, such as environmental and weather conditions; and internal factors, e.g., driver behaviors and information, such as gender and age; these can be used to understand which factors interfere with each other or any linkage between them that increases the chances of fatality. According to the Swiss cheese theory [3], if all of the holes (factors) are aligned by chance, an accident will happen and result in death. In contrast, the risk may be decreased by controlling the primary element that has the strongest influence on fatality. For example, a researcher noted that accidents are typically caused by a combination of circumstances rather than by one or two factors. In addition, if the elements were combined, how likely is it that someone would die? However, what happens if a risk factor is reduced? This is why forecasts have appeared in order to simulate situations. However, predicting an accident event is also essential for establishing road safety, budgeting, staffing, and policy planning.
Earlier research on road traffic accidents also categorized them according to variables in forms that were presumed to be associated with every accident, according to international research.
Age: Zhang and Fan [24] found that accidents are more likely to occur among junior drivers (≤25 years) who have a lack of discipline, are inexperienced with traffic regulations, and have less driving experience. The majority of traffic accidents in Dubai are caused by a lack of space between vehicles, with the youth (≤35 years) being the most commonly involved; the peak hours are late at night and the overwhelming majority of drivers have been discovered to be inebriated [18]. Young (18-24 years old) drivers lack experience in controlling their speed and adjusting well while driving [25]. John and Shaiba [22] found that the majority of alcohol-involving accidents are caused by youths (≤35 years) late at night.
Gender: Ospina-Mateus, et al. [26], Mohamad, et al. [27] observed that men are more likely to be involved in serious accidents than women. Driver behaviors: When compared to other drivers, intoxicated drivers have a higher accident rate [15]. The most important aspect in predicting the severity of an injury is driving over the speed limit [7].
Driver: Drivers are more likely to be injured or killed in accidents than other passengers [16].
Time: Traveling at night increases the chances of car accidents [28]. Road and light conditions: Chen, et al. [29] observed that road slope and visibility were predictors of driver injuries. Highway intersections are riskier for all accident types. Poor road conditions increase the likelihood of accidents, especially on motorways [30]. The road type, lighting, speed limits, and road surface all play key roles in accident incidence [19]. The majority of fatal injuries occur as a result of aggressive driving, inattentiveness, and speeding. However, compared with other situations, dark or dim roads also play significant roles [31].
Weather conditions: [14] Sonal and Suman [4] observed that external factors, including weather conditions, such as fog, rain, and snow, have greater impacts on road accidents than internal factors, such as the driver.
Types of vehicles: Chen, et al. [32] mentioned that this factor is significant for driver injuries and fatalities in rear-end accidents involving trucks, lighting, wind, and multiple vehicles. The analysis revealed that the most essential and impactful traffic accident elements are speed limit, weather conditions, number of lanes, lighting conditions, and accident timing while gender, age, accident location, and vehicle type have less of an impact on severity [10].
Researchers are continuing to evaluate the literature on road accidents and the factors involved. Though a wide range of research from across the world has been covered, Table 2 concentrates on research from the same region as that in this study. Table 2. Previous research identifying the factors that determine the severity of driving injuries.

Data Description
According to data collected by a government organization in Thailand, there were a total of 167,820 road accidents reported between 2015 and 2020 PDPM [54]. This study specifically examines the subset of drivers who were responsible for their accidents, totaling 129,015 accidents, of which 95,249 were non-fatal and 33,766 were fatal (24,559 on highways and 9207 on non-highways). To analyze this dataset, this research employed a data analysis technique involving the steps outlined in Figure 2: − Data cleaning: missing and incompletely captured data were detected and corrected; − Data validation: the quality of the data was assessed after the dataset was cleaned was validated; − Data conversion: to facilitate data analysis, the data were partitioned into binary mode; − Data analysis and interpretation: the research team then conducted an in-depth analysis of the data to uncover insights that would inform their conclusions; − Data visualization: data visualization techniques were used to create a visual representation of the information and data for enhanced clarity and understanding.

−
Data conversion: to facilitate data analysis, the data were partitioned into binary mode; − Data analysis and interpretation: the research team then conducted an in-depth analysis of the data to uncover insights that would inform their conclusions; − Data visualization: data visualization techniques were used to create a visual representation of the information and data for enhanced clarity and understanding.

Figure 2.
Steps of the data analysis process. Table 3 comprises data that were classified into four distinct categories, which included fatalities (HW and NHW) and non-fatalities (HW and NHW), in order to identify any correlations between road types and accidents. However, this particular study focused solely on highway fatalities. The decision to prioritize highway accidents is underpinned by their distinctive characteristics compared to incidents occurring on urban streets. Highway accidents often involve higher speeds and longer road stretches, thus potentially amplifying collision severity and consequences and necessitating tailored safety interventions. Moreover, the factors contributing to highway accidents might diverge from those in urban contexts due to highway-specific features, such as the longer distances between exits and fewer intersections, which influence driver behavior and accident causation dynamics. This focus on highway accidents enables an exploration of these unique factors to inform targeted preventive strategies. Additionally, highway accidents involve a distinct demographic of drivers, including long-haul truckers and extended commuters, thus introducing specific risk factors that warrant thorough investigation. The relatively limited presence of pedestrians and cyclists on highways, as opposed to city streets, necessitates an individualized approach to safety analysis that acknowledges the distinct patterns that emerge. Lastly, the impacts of road design, signage, and maintenance on highway safety set highways apart from urban streets; by scrutinizing highway accidents, an evaluation of highway-specific safety measures and infrastructure effectiveness emerges, thus providing insights that are not necessarily applicable to city streets.
To facilitate data analysis, the research team converted the overall dataset into a binary format, where each accident event was represented as either a "Yes" or "No" value and input into Python-based software. Table 3 presents the data segregated by road type and fatality. Notably, the large number of accidents (24,599, denoted by an asterisk in Table 3) captured our attention and motivated us to explore this further. Table 3 provides an overview of accidents caused by drivers that are categorized by whether they occurred on highways or non-highways.   Steps of the data analysis process. Table 3 comprises data that were classified into four distinct categories, which included fatalities (HW and NHW) and non-fatalities (HW and NHW), in order to identify any correlations between road types and accidents. However, this particular study focused solely on highway fatalities. The decision to prioritize highway accidents is underpinned by their distinctive characteristics compared to incidents occurring on urban streets. Highway accidents often involve higher speeds and longer road stretches, thus potentially amplifying collision severity and consequences and necessitating tailored safety interventions. Moreover, the factors contributing to highway accidents might diverge from those in urban contexts due to highway-specific features, such as the longer distances between exits and fewer intersections, which influence driver behavior and accident causation dynamics. This focus on highway accidents enables an exploration of these unique factors to inform targeted preventive strategies. Additionally, highway accidents involve a distinct demographic of drivers, including long-haul truckers and extended commuters, thus introducing specific risk factors that warrant thorough investigation. The relatively limited presence of pedestrians and cyclists on highways, as opposed to city streets, necessitates an individualized approach to safety analysis that acknowledges the distinct patterns that emerge. Lastly, the impacts of road design, signage, and maintenance on highway safety set highways apart from urban streets; by scrutinizing highway accidents, an evaluation of highway-specific safety measures and infrastructure effectiveness emerges, thus providing insights that are not necessarily applicable to city streets. To facilitate data analysis, the research team converted the overall dataset into a binary format, where each accident event was represented as either a "Yes" or "No" value and input into Python-based software. Table 3 presents the data segregated by road type and fatality. Notably, the large number of accidents (24,599, denoted by an asterisk in Table 3) captured our attention and motivated us to explore this further. Table 3 provides an overview of accidents caused by drivers that are categorized by whether they occurred on highways or non-highways. Table 4 contains data from every event, encompassing 34 attributes related to accident data collection. These attributes include details such as the roadway type, vehicle type, environmental conditions, weather conditions, driver behavior, driver information, and driver status.

Methodology
The Apriori algorithm [55] was utilized to conduct frequent itemset mining on a large relational dataset to uncover the most common individual items and extend them to larger itemsets, as long as they appeared frequently enough in the database. The resulting frequent itemsets generated by Apriori could then be used to generate association rules that revealed overall trends. Association rule learning is a machine learning method that employs rules to identify strong relationships between variables within large databases by using various measures of attraction [56]. By detecting correlations and co-occurrences between datasets, association rules are useful for explaining data patterns that may appear to be unrelated, such as those found in relational and transactional databases. This process of applying association rules is known as association rule mining or mining associations. Please refer to Figure 3 for further details. to be unrelated, such as those found in relational and transactional databases. This process of applying association rules is known as association rule mining or mining associations. Please refer to Figure 3 for further details.

Rule definition and measurement
An association rule is determined by two factors: support and confidence. The frequency with which a specific rule appears in the database being mined is referred to as the support. The number of times that a particular rule turns out to be true in practice is referred to as the confidence: Let I = {...} represent a collection of "n" binary characteristics known as items; Let J = {...} be a set of transactions referred to as a database. Each transaction in J has a distinct transaction ID and includes a subset of the items in I. A rule is defined as an implication of the type xy, in which x, y ⊆ I if only x ≠ ∅, y ≠ ∅, and x ∩ y = ∅. The sets of objects x and y are referred to as the rule's antecedent and consequent, respectively. Support (1) is an indicator of how frequently an itemset appears in the dataset: Confidence (2) is an indication of how often a rule has been found to be true: Lift (3) is the ratio of the observed support to the support expected if x and y are independent: A rule may have a significant association in a collection of data because it frequently appears; but, it may occur considerably less frequently when implemented. This would be an example of strong support but low confidence.
The following steps were used to perform associated rule mining: • The accident transactions were sequenced by event (binary): If there was minimal support, the effectiveness of the accident was measured. If it was >50% (threshold), then others below 50% were removed; • The frequency itemset from 1 was used to build a new itemset (length: 2). After using the join command, if all were set, the sequencing did not matter;

Rule definition and measurement
An association rule is determined by two factors: support and confidence. The frequency with which a specific rule appears in the database being mined is referred to as the support. The number of times that a particular rule turns out to be true in practice is referred to as the confidence: Let I = {...} represent a collection of "n" binary characteristics known as items; Let J = {...} be a set of transactions referred to as a database. Each transaction in J has a distinct transaction ID and includes a subset of the items in I. A rule is defined as an implication of the type xy, in which x, y ⊆ I if only x = ∅, y = ∅, and x ∩ y = ∅. The sets of objects x and y are referred to as the rule's antecedent and consequent, respectively. Support (1) is an indicator of how frequently an itemset appears in the dataset: Confidence (2) is an indication of how often a rule has been found to be true: Lift (3) is the ratio of the observed support to the support expected if x and y are independent: A rule may have a significant association in a collection of data because it frequently appears; but, it may occur considerably less frequently when implemented. This would be an example of strong support but low confidence.
The following steps were used to perform associated rule mining: • The accident transactions were sequenced by event (binary): If there was minimal support, the effectiveness of the accident was measured. If it was >50% (threshold), then others below 50% were removed; • The frequency itemset from 1 was used to build a new itemset (length: 2). After using the join command, if all were set, the sequencing did not matter; • The support score was recalculated by using the transaction in 1. The following two items or more were considered and then the confidence and lift were calculated.
It is important to note that a rule may have a significant association in a collection of data because it frequently appears; but, it may occur considerably less frequently when implemented. This would be an example of strong support but low confidence.
Considering its ability to identify frequent itemsets, generate association rules, provide insights into complex relationships between factors, scale well with large datasets, and have an easy implementation process, the Apriori algorithm is a valuable tool for accident data analysis. Because of these benefits, it is an effective approach for understanding the factors that contribute to accidents and informing evidence-based decision making in accident prevention and road safety improvement. However, it is computationally demanding, consumes significant memory, generates redundant rules, and has limitations with implicit itemsets.

Descriptive Statistics and Results
In order to gain insight into the patterns and distribution of the data, a distribution chart was generated for 72,672 highway accidents over a 24-hour period by using kernel density as a time series for descriptive statistics, as shown in Figure 4. To distinguish between day and night periods, the following values were assigned:   1-representing fatalities from highway accidents; µ = 13.19, σ = 7.03; 0-representing non-fatalities from highway accidents; µ = 13.57, σ = 6.37. The majority of accidents occurred during the daytime (08.00-18.00) while peaks occurred at 19.00-20.00 and 22.00-23.00; a high fatality rate occurred at night (19.00-07.00).
Subsequently, the researchers focused on frequent itemsets related to fatality to extract rules that highlighted causal relationships, as illustrated in Figure 5. Identifying the cooccurrence of elements assisted in identifying linkages between them, with a minimum support of 50%. As shown in Figure 5, the most commonly occurring itemset in the 2018 dataset was associated with the following items: dry roads (95.98%), clear weather (87.33%), male drivers (86.42%), motorcycles (80.77%), straight roadways (71.99%), and exceeding the speed limit (69.03%). Safety 2023, 9, x FOR PEER REVIEW 11 of 21 Following the analysis of the frequent itemsets in the highway fatality dataset, a total of 1558 association rules (1377 of which had a lift of ≥1) were generated, meeting the set threshold criteria (support 50%, confidence 95%). This was accomplished by using the Orange 3.30 software [57]; the results are presented in Figure 6. The support distribution had a mean of µ = 0.680263 and a standard deviation of σ = 0.0954974 while the confidence distribution had a mean of µ = 0.972597 and a standard deviation of σ = 0.0126851. Following the analysis of the frequent itemsets in the highway fatality dataset, a total of 1558 association rules (1377 of which had a lift of ≥1) were generated, meeting the set threshold criteria (support 50%, confidence 95%). This was accomplished by using the Orange 3.30 software [57]; the results are presented in Figure 6. The support distribution had a mean of µ = 0.680263 and a standard deviation of σ = 0.0954974 while the confidence distribution had a mean of µ = 0.972597 and a standard deviation of σ = 0.0126851.
In total, 1558 rules were discovered through rule mining and were clustered based on their confidence levels, which are represented by different color shades. The y-axis displays the confidence while the x-axis represents the support. The results show that Group 1 (confidence: 0.95-0.965) had a majority of rules with the antecedent being male and dry surfaces being the consequence; this is represented by the blue shade. Group 2 (confidence: 0.965-0.98) had a majority of rules with the antecedent being motorcycles and driving over the speed limit and the consequence being dry surface roads; this is represented by the green shade. Group 3 (confidence: 0.98-0.995) had high confidence but low support, with clear weather as the antecedent and dry surface as the consequence; this is represented by the yellow shade. This suggested that these two elements played a significant role in road accident mortality (Figure 7) and it is essential to exercise extreme caution during clear weather on dry surfaces. In total, 1558 rules were discovered through rule mining and were clustered based on their confidence levels, which are represented by different color shades. The y-axis displays the confidence while the x-axis represents the support. The results show that Group 1 (confidence: 0.95-0.965) had a majority of rules with the antecedent being male and dry surfaces being the consequence; this is represented by the blue shade. Group 2 (confidence: 0.965-0.98) had a majority of rules with the antecedent being motorcycles and driving over the speed limit and the consequence being dry surface roads; this is represented by the green shade. Group 3 (confidence: 0.98-0.995) had high confidence but low support, with clear weather as the antecedent and dry surface as the consequence; this is represented by the yellow shade. This suggested that these two elements played a significant role in road accident mortality (Figure 7) and it is essential to exercise extreme caution during clear weather on dry surfaces.
A hierarchical cluster analysis (HCA) was performed by applying an agglomerative A hierarchical cluster analysis (HCA) was performed by applying an agglomerative analysis to 1558 rules to group related antecedents into clusters with distances. The Euclidean distance was used as a complete linkage criterion to calculate the distance between the clusters. The resulting dendrogram (Figure 8) shows three clusters for the antecedent. Cluster 1 (C1) contains straightaways, driving over the speed limit, dry surface roads, clear weather, and male gender. Cluster 2 (C2) contains straightaways, driving over the speed limit, clear weather, and male gender. Cluster 3 (C3) contains motorcycles, driving over the speed limit, clear weather, and male gender.
identified. The rules are plotted in Figure 9 and presented in Table 5, with a minimum support score of 50%, a confidence threshold of 95%, and a lift threshold of 1. For instance, the rule with the widest gap between the support and confidence involved straightaways, clear weather, and motorcycles as antecedents and dry surface roads as a consequence, with an increase from a support of 0.511 to a confidence of 0.995 by 0.484. Additionally, the rule with the highest lift was associated with different antecedents; but, all of them contained motorcycles.    In order to determine the factors leading to motorcycle fatalities, this study utilized association rule mining and hierarchical clustering analysis. The results showed that the majority of motorcycle fatalities occurred on straightaways while driving over the speed limit and clear weather also played a significant role. On the other hand, dry surface roads were found to be a common consequence of the antecedents in clusters C2 and C3. To further explore the relationships between the antecedents and consequences, a set of association rules with a high lift and a wide gap between the support and confidence were identified. The rules are plotted in Figure 9 and presented in Table 5, with a minimum support score of 50%, a confidence threshold of 95%, and a lift threshold of 1. For instance, the rule with the widest gap between the support and confidence involved straightaways, clear weather, and motorcycles as antecedents and dry surface roads as a consequence, with an increase from a support of 0.511 to a confidence of 0.995 by 0.484. Additionally, the rule with the highest lift was associated with different antecedents; but, all of them contained motorcycles.

Discussion
According to this study, the higher risk of accidents on clear straight roads may be due to drivers-particularly male drivers-violating speed limits in good weather conditions. Thailand has over 42 million registered vehicles, with motorcycles accounting for 50% of the total and being responsible for the majority of road fatalities [58], thus potentially contributing to the largest number of fatalities from significant accidents. As Jomnonkwao, Uttra and Ratanavaraha [2] observed, motorcyclists are responsible for the vast majority of road fatalities; meanwhile, prior studies showed different types of cars and motorcycles, such as SUV/vans [47], large trucks [40,47,49], and pick-ups [40], that have rolled over. Additional research on motorcycle riders specifically, as well as other types of road users, may be conducted in the future. Aside from motorcycles, Sonal and Suman [4] observed that external factors, such as weather conditions, including fog, rain,

Discussion
According to this study, the higher risk of accidents on clear straight roads may be due to drivers-particularly male drivers-violating speed limits in good weather conditions. Thailand has over 42 million registered vehicles, with motorcycles accounting for 50% of the total and being responsible for the majority of road fatalities [58], thus potentially contributing to the largest number of fatalities from significant accidents. As Jomnonkwao, Uttra and Ratanavaraha [2] observed, motorcyclists are responsible for the vast majority of road fatalities; meanwhile, prior studies showed different types of cars and motorcycles, such as SUV/vans [47], large trucks [40,47,49], and pick-ups [40], that have rolled over. Additional research on motorcycle riders specifically, as well as other types of road users, may be conducted in the future. Aside from motorcycles, Sonal and Suman [4] observed that external factors, such as weather conditions, including fog, rain, and snow, showed greater impacts on road accidents than internal factors, such as the drivers themselves. Meanwhile, Thailand's climate has no snow or ice and rain is only present for roughly five months of the year. The remainder of the year has clear weather conditions and dry road surfaces in the chilly and summer seasons. Further research on motorcycle riders and other road users is necessary.
In a previous study, highway junctions were identified as the most hazardous locations for accidents [14]. However, this current research highlights that straight roads without junctions pose a significant risk due to drivers often exceeding speed limits. Additionally, previous studies by Bahiru, Kumar Singh and Tessfaw [10] showed that internal factors, such as gender, age, accident location, and vehicle type, have a relatively minor impact on the severity of accidents; although, being male remains a significant contributing factor to fatalities on highways.
This study's findings have important implications for policymakers working to reduce the factors that contribute to highway accidents and raise awareness of risky driving behaviors. Policymakers can develop targeted measures to address these factors and improve road safety by considering the discovered association rules. Implementing laws that control speed limits, specifically on straightaways, is one potential measure. To remind drivers of the safe speed range, light signs indicating the appropriate speed limit can be strategically placed along these road segments. Additionally, warning signs can be used to alert drivers to potential hazards and encourage them to drive cautiously. Installing cameras to monitor driving speeds, especially on motorcycles, can be an effective deterrent for speeding. The Thai government has already taken steps to reduce road accidents by improving infrastructure, enforcing traffic laws, and implementing safety education and awareness programs in schools and workplaces. These initiatives seek to instill a sense of responsibility in individuals and educate them on the importance of following traffic rules and practicing safe driving habits. However, while these efforts are commendable, more comprehensive measures are required to address the underlying causes of accidents. For instance, there is a need to focus on enhancing safety awareness among drivers and promoting responsible behavior on the roads. This could involve targeted awareness campaigns that highlight the potential consequences of reckless driving, as well as educational programs that provide drivers with the necessary skills and knowledge to navigate challenging road conditions.
In the context of this discussion, it is critical to identify the distinguishing features that set Thailand apart from other countries in terms of its high rate of road accidents. This situation is the result of several distinct factors, emphasizing the importance of a tailored and nuanced approach to road safety initiatives.
To begin, in Thailand's road safety landscape, the cultural dimension of alcohol consumption is critical. Thailand's sociocultural norms include widespread acceptance of alcohol consumption, which can inadvertently increase the prevalence of drunk driving incidents. This cultural attitude toward alcohol, combined with limited enforcement and public awareness campaigns, may contribute to an increase in the number of road accidents involving intoxicated drivers, thus distinguishing Thailand from countries with different attitudes toward alcohol consumption and stringent anti-drunk-driving laws. Another unique aspect contributing to Thailand's road safety challenges is the issue of drivers operating vehicles without proper licenses. This phenomenon could be attributed to a number of factors, such as lax enforcement of licensing regulations and difficulties in ensuring compliance due to the country's geographical and administrative complexities. This trend differs from that in regions where stricter licensing regulations are more effectively enforced, resulting in a significant difference in the prevalence of unlicensed drivers contributing to road accidents. The state of the road infrastructure is also an important factor to consider. While Thailand has experienced rapid economic development, modernization of the road infrastructure has not kept pace. Some regions may have cutting-edge road networks while others may be in desperate need of maintenance and improvement. This disparity in road infrastructure quality combined with the varying levels of urbanization and development may contribute to disparities in accident rates across the country, thus distinguishing Thailand from countries with more uniformly developed road networks.
Furthermore, Thailand's urban landscape is unique, with a mix of urban centers, rural areas, and tourist destinations, which contributes to a diverse range of road users and driving conditions. This complex mix of environments can make it difficult to develop comprehensive road safety strategies that effectively address the needs of these various contexts. The coexistence of bustling cities, remote rural settings, and tourist-heavy regions complicates efforts to harmonize road safety measures. To summarize, Thailand's high rate of road accidents can be attributed to a combination of cultural factors, licensing issues, varying road infrastructure quality, and the diversity of its urban landscape. These features distinguish Thailand from other countries and highlight the need for tailored road safety strategies that address these distinguishing features effectively.
In essence, this study advances beyond established knowledge by uncovering hidden nuances in the antecedents of road accidents and their implications. The incorporation of insights from a government official underscores the practical value of our findings and their potential impacts on road safety policies and interventions in Thailand.

Conclusions
The association rule analysis performed in this study identified several key factors that significantly increase the likelihood of fatalities in highway accidents. Male drivers, speeding, motorcycles, straight and dry roads, and clear weather were identified as inter-connected variables associated with an increased risk of injury or death in traffic accidents. The highest risk was observed for males riding motorcycles at speeds exceeding the speed limit on straight roads in clear weather. The confidence levels in the association rules gradually increased, indicating a stronger relationship between these factors. Notably, the presence of multiple factors increases the likelihood of an accident. Straightaways being identified as a significant contributor to accidents emphasizes the importance of exercising caution at intersections and on curved roads.
The rule pertains to males who ride motorcycles at speeds that exceed the posted speed limit while traveling on straight roads under clear weather conditions. While these findings may appear obvious, this algorithm assists in uncovering and quantifying the relationships between these factors in a systematic manner that goes beyond common sense. In essence, this study provides a structured method for confirming what may be intuitively understood. This method improves our understanding of how these factors interact to increase the likelihood of an accident. As a result, the importance of this study stems from its rigorous methodology, which uncovers and quantifies the complex relationships among the identified variables. Despite the factors' apparent simplicity, this study's strength lies in its ability to reveal the intricate connections between them. This greater understanding can help guide more effective strategies and policies for reducing the risks of traffic accidents.
In conclusion, policymakers should consider the association rules uncovered in this study as a basis for designing and implementing effective strategies for reducing highway accidents. By combining legislative measures, infrastructure improvements, enforcement efforts, and educational initiatives, it is possible to create a safer road environment and foster a culture of responsible driving. Continued efforts and collaboration among relevant stakeholders are vital for addressing the complex factors contributing to accidents and ensuring the wellbeing of road users in Thailand.

Limitations and Further Research
This study utilized accident data from the COVID-19 pandemic, during which the government imposed lockdowns and restrictions on travel between provinces. People were also cautious about traveling to isolated areas on their own, which suggests that they did not travel extensively. Therefore, the accident and fatality numbers for 2019-2020 may not accurately reflect the actual figures for the country.
As a related aspect, future research may expand the analysis to include all road types, specific types of vehicles, criminal and medical data, and non-highway data to assist policymakers in selecting the most practical options with solid data support.
Furthermore, the incorporation of autonomous driving technology has emerged as a compelling approach to reducing the occurrence of road accidents as a promising avenue for future research. With advancements in artificial intelligence and automation, self-driving vehicles have the potential to revolutionize road safety by reducing the role of human error, which is a major cause of accidents [59]. Exploring the feasibility, efficacy, and implications of introducing autonomous driving technology within the context of Thailand's unique road safety landscape could provide valuable insights. This line of inquiry could look into infrastructure readiness, regulatory changes, public acceptance, and potential benefits, thus contributing to the region's ongoing discussion about improving road safety [60].

Institutional Review Board Statement:
This study was conducted in accordance with the Declaration of Helsinki and approved by the Human Research Ethics Committee of Suranaree University of Technology (EC-65-13).

Informed Consent Statement: Not applicable.
Data Availability Statement: Data available on request due to restrictions.