# Water Quality Evaluation and Analysis by Integrating Statistical and Machine Learning Approaches
## 4 Results and Discussion
### Assumption and Diagnostic Tests
#### 4.1.2 Shapiro-Wilk Test Results  
The Shapiro-Wilk test assesses normality through a test statistic and \(p\)-value, supported by a Q-Q (quantile-quantile) plot (Figure 7). The obtained \(p\)-value (0.0) confirms a significant departure from normality at the 0.05 significance level. The test statistic (0.431), which significantly deviates from 1, reinforces this conclusion. The Q-Q plot, with theoretical quantiles on the x-axis and sample residual quantiles on the y-axis, exhibits a step-like residual pattern that clearly deviates from the diagonal reference line. This indicates non-normality in the residuals, suggesting that they may be discretely grouped, skewed, or influenced by underlying distributional irregularities, which could compromise model validity.  
Figure 6: Residual vs. fitted values plot. Blue dots represent the residuals for each observation, and the red line represents the reference line at zero residual, indicating perfect model fit.  
Figure 7: Q-Q plot of residuals. The x-axis represents theoretical quantiles, and the y-axis represents sample quantiles of residuals. Blue dots represent the ordered standardized residuals and the red diagonal line represents the theoretical quantiles from a normal distribution. Deviation from the red diagonal line indicates non-normality, consistent with the Shapiro-Wilk test result.  
To improve and evaluate the robustness of the predictive model, a few diagnostic analyses are carried out and visualized. The Q-Q plot of the Ordinary Least Squares (OLS) residuals, which are shown in Figure 8, top left, demonstrates that the residuals closely match to the theoretical normal distribution line. This indicates that the criterion of normality is satisfactorily met.  
There is a similar trend that can be seen in the Q-Q plot of residuals that is created after the Box-Cox transformation (top right). This plot displays a minor deviation, which suggests that even though the transformation may slightly improve symmetry, the original residuals already approximate a normal distribution. A comparison of the residual distributions of OLS and robust regression using Huber loss (bottom left) reveals that the Huber model produces a more constrained and symmetric residual dispersion, hence reducing  
Figure 8: Diagnostic plots supporting remedial strategies for assumption violations: (**a**) Q-Q plot of OLS residuals, where orange dots represent the ordered standardized residuals and the red line represents the theoretical quantiles from a normal distribution; (**b**) Q-Q plot after Box-Cox transformation, with the same color coding as (**a**); (**c**) histogram of residuals comparing Ordinary Least Squares (OLS, blue bars with blue density curve) and Huber robust regression (red bars with red density curve); (**d**) bootstrapped distribution of residual means, where yellow bars represent the distribution and the overlaid orange line represents the fitted normal density curve.  
the impact of extreme values and potential outliers. This is demonstrated by the fact that the Huber model provides a more similar residual dispersion. The case illustrates that the alternative model is resilient even when the data conditions are not optimal. Thus, the histogram of bootstrapped residual means, which can be found in the bottom right corner, exhibits a bell-shaped curve that is centered around zero. This observation provides evidence that non-parametric resampling approaches can produce reliable interval estimates without the need for severe parametric assumptions. When taken as a whole, these diagnostic charts establish the statistical integrity of the model and demonstrate how transformation, robust regression, and bootstrapping can serve as corrective procedures if standard assumptions are violated.