# Assessing Fatality Risks in Maritime Accidents: The Influence of Key Contributing Factors
## 4 Materials and Methods
### Methodology
#### 4.2.3 Chi-Squared Automatic Interaction Detector (CHAID)  
CHAID is a statistical technique used to create decision trees for classification and regression tasks. This method identifies the optimal splits of the data based on the chi-squared test of independence for categorical variables or the F-test for continuous variables [43; 44].  
The CHAID algorithm begins by identifying the input variable that has the strongest association with the outcome variable. For categorical predictors, the association is evaluated using the chi-squared test of independence, while for continuous predictors, the F-test is used. The steps involved are as follows. The dataset is initially split based on each predictor variable. For categorical variables, each category forms a potential split. For continuous variables, the data are divided into intervals. The next step is merging. For each predictor, pairs of categories or intervals are merged if their \(p\)-value from the chi-squared test (or F-test) exceeds a specified significance level. This merging process continues until no further merging is possible without exceeding the \(p\)-value significance level. The last step is selection. The predictor variable and corresponding split that result in the most significant association with the outcome variable (identified by the lowest \(p\)-value) are selected. This split maximises the difference between the resulting subsets with respect to the outcome variable [43; 44].  
The CHAID tree is constructed by recursively applying the splitting criterion to each subset until a stopping condition is met. The stopping conditions may include a minimum number of observations per node, a maximum tree depth, or a \(p\)-value threshold. In this paper, the CHAID tree was constructed using the following stopping criteria: maximum tree depth 5; minimum records in parent branch 2% and in child branch 1% of cases in training sample; minimum change in expected call frequencies for chi-squared test 0.001; maximum iterations for convergence 100 [40].  
Unlike CART, CHAID incorporates an automatic pruning mechanism during the tree construction process. As the tree grows, nodes that do not contribute significantly to the overall model (based on the \(p\)-value threshold) are not split further, effectively controlling the complexity of the tree and reducing overfitting [45].  
The CHAID method is advantageous due to its ability to handle both categorical and continuous variables, its robustness to missing values, and its straightforward interpretation of results. Moreover, CHAID is particularly effective for detecting interactions between variables. However, CHAID trees can be sensitive to outliers and may produce splits that are less intuitive than those from other tree methods. Additionally, the reliance on \(p\)-values means that the results can be influenced by the sample size, with larger samples potentially leading to more splits [46].  
All calculations in this article were conducted using IBM SPSS Modeler, version 18.3. Data preparation was partially carried out using IBM SPSS Statistics, version 28. A significance level of 0.05 was used for all statistical tests.