## 3 Materials and Methods
### Experimental Setup and Implementation
#### 3.3.6 ANOVA Analysis  
The statistical analysis of variance method (ANOVA) [28] is used to analyze the data from the three experimental designs. The ANOVA method employs a hypothesis test to determine the factors that are statistically significant (\(p\)-value < 0.05), by means of the F-test with a confidence level of 95%. The percentage contribution (P%) of each factor is then used to quantify the degree of influence of each factor on each response. The ANOVA method is detailed in Ref. [28]. We give below the formulas used for ANOVA calculations.  
1. The total sum of squares: \[\text{SS}_{\text{T}}=\sum_{i=1}^{n}(y_{i}\ -\mu)\] (8)  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Factor** & **Variable** & **Low Level (\(-\)1)** & **High Level (+1)** \\ \hline Black Hole attack & BKH & 0 & 1 \\ Wormhole attack & WMH & 0 & 1 \\ Node Density & ND & 50 & 150 \\ Number of Connections & NC & 4\% & 20\% \\ \hline \hline \end{tabular}
\end{table}
Table 2: Values of low and high levels for factors.  
where \(y_{i}\) is the response of the \(i\)-th experiment, \(\mu\) represents the mean of all responses, and n is the number of all experimental runs.  
2. The sum of squares of error: \[\text{SS}_{\text{E}}=\text{ }\text{SS}_{\text{T}}-\sum_{i=1}^{k}\text{SS}_{ \text{i}}\] (9) where \(\text{SS}_{\text{i}}\) is the sum of squares of the \(i\)-th factor and \(k\) the number of factors.  
3. Mean of squares or the variance: \[\text{MS}=\frac{\text{SS}}{df}\] (10) where \(df\) is the degree of freedom. It is equal to number of levels minus 1 for a given factor X. The total degrees of freedom are equal to the number of all experimental runs minus 1.  
4. F-ratio: the variance of a factor X to the variance of error: \[\text{F}_{\text{X}}=\frac{\text{MS}_{\text{X}}}{\text{MS}_{\text{E}}}\] (11)  
5. The percentage of contribution of factor X: \[\text{P}\%=\frac{\text{SS}_{\text{X}}}{\text{SS}_{\text{E}}}\] (12)  
The measured experimental responses are employed in both the PBM and the FFM, whereas the Taguchi method makes use of the SNR analysis. Indeed, the Taguchi method converts the measured responses to signal-to-noise ratios (SNR). The SNR measures how the response varies relative to a target function defined depending on the goal of the experiment. If the goal is to maximize the response, then the \"larger-the-better\" (LTB) formulation is selected, and when the objective is to minimize the response, \"smaller-the-better\" (STB) is adopted.  
In our study, LTB is chosen for throughput and STB is assigned to the packet loss ratio, average end-to-end delay and routing overhead.  
Smaller-the-better (STB),  
\[\text{SNR}=-10\ log\left[\frac{1}{N}\sum_{u=1}^{N}\left(y_{u}\right)^{2}\right] \tag{13}\]  
Larger-the-better (LTB),  
\[\text{SNR}=-10\ log\left[\frac{1}{N}\sum_{u=1}^{N}\frac{1}{\left(y_{u}\right)^ {2}}\right] \tag{14}\]  
where \(N\) is the number of repetitions for an experiment, and \(y_{u}\) is the corresponding measured value of a response, such as throughput, packet loss ratio, average end-to-end delay or routing overhead. In this study, three repetitions are performed for each experiment.