# Causally Remove Negative Confound Effects of Size Metric for Software Defect Prediction
## 4 Experiments and Results
### Experiments for Software Defect Prediction  
To verify the effectiveness of CRNCEM for software defect prediction, we selected the LR as the basic classifier. We compared CRNCEM + LR with LR and LCERM + LR with NN. For each model, we conducted 20 experiments on each dataset. In each experiment, we randomly selected 70% defective instances and 70% nondefective instances as the training data, and the remaining data was selected as the test data. We use the widely used F1 to evaluate the prediction model objectively. F1 considers the precision rate and recall rate, and it can be interpreted as the harmonic average. We ran the experiments on the R platform. The description of baselines is as follows: \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**No.** & **Before** & **After** & **No.** & **Before** & **After** \\ \hline
14 & 1.21360581 & **0.62377762** & 39 & 1.42134641 & **0.80776073** \\
15 & 1.60637049 & **0.54697256** & 40 & 1.23076289 & **0.58067971** \\
16 & **1.01512873** & 7.66267773 & 41 & 1.020563 & **0.42465768** \\
17 & **1.01512873** & 7.66266016 & 42 & 1.01249155 & **0.39076503** \\
18 & 5.14091233 & **0.21524267** & 43 & 0.92956176 & **0.54646159** \\
19 & 0.59778389 & **0.11330263** & 44 & 1.07764792 & **0.5408485** \\
20 & 1.41457559 & **0.02526074** & 45 & 0.69516539 & **0.54811949** \\
21 & 0.80556418 & **0.05279058** & 46 & 0.54736503 & **0.5080965** \\
22 & 0.24675853 & **0.07165685** & 47 & 1.06996538 & **0.0952129** \\
23 & 0.75537306 & **0.256155** & 48 & 0.16973463 & **0.02677171** \\
24 & 0.55150994 & **0.01352926** & 49 & 1.13618234 & **0.60511507** \\
25 & 1.28668765 & **0.28035742** & 50 & 3.14271644 & **0.11579495** \\ \hline \hline \end{tabular}
\end{table} 
Table 4: _Cont._ \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**No.** & \(p\) **(Before)** & \(p\) **(After)** & **No.** & \(p\) **(Before)** & \(p\) **(After)** \\ \hline
1 & 0.552089 & 0.000426 & 26 & 0.645646 & 0.592678 \\
2 & 0.062499 & 0.052427 & 27 & 0.152232 & 0.0955 \\
3 & 0.009475 & 0.001651 & 28 & 0.149536 & 0.056501 \\
4 & 0.07769 & 0.049576 & 29 & 0.270153 & 0.145442 \\
5 & 0.838962 & 0.30189 & 30 & 0.108692 & 0.000983 \\
6 & 0.008734 & 0.001084 & 31 & 0.907629 & 0.305661 \\
7 & 0.860716 & \(4.51\times 10^{-10}\) & 32 & 0.892005 & \(9.28\times 10^{-5}\) \\
8 & 0.907209 & 0.875188 & 33 & 0.529383 & 0.091709 \\
9 & 0.799039 & 0.617127 & 34 & 0.029144 & 0.000474 \\
10 & 0.002145 & 0.007784 & 35 & 0.002593 & 0.001247 \\
11 & 0.340842 & 0.25716 & 36 & 0.470502 & \(9.49\times 10^{-8}\) \\
12 & 0.000773 & \(2.52\times 10^{-21}\) & 37 & 0.773238 & 0.408584 \\
13 & 0.058539 & \(2.84\times 10^{-26}\) & 38 & 0.773237 & 0.408584 \\
14 & 0.357811 & 0.007715 & 39 & 0.002727 & 0.000638 \\
15 & 0.000165 & \(2.37\times 10^{-23}\) & 40 & 4.52 \(\times 10^{-6}\) & 1.13 \(\times\)\(10^{-11}\) \\
16 & 0.311558 & 0.02087 & 41 & 0.702683 & \(7.92\times 10^{-14}\) \\
17 & 0.311559 & 0.02087 & 42 & 0.818782 & \(3.91\times 10^{-15}\) \\
18 & 0.036333 & \(2.76\times 10^{-14}\) & 43 & 0.530805 & \(3.02\times 10^{-11}\) \\
19 & 0.205085 & 0.012515 & 44 & 0.110961 & \(9.89\times 10^{-12}\) \\
20 & 0.200439 & 0.078343 & 45 & 0.023705 & \(4.35\times 10^{-14}\) \\
21 & 0.637238 & 0.378287 & 46 & 0.035566 & \(2.31\times 10^{-6}\) \\
22 & 0.838157 & 0.80505 & 47 & 3.01E-08 & \(1.1\times 10^{-22}\) \\
23 & 0.795415 & 0.460198 & 48 & 0.003991 & 0.000727 \\
24 & 0.892006 & 0.769109 & 49 & 0.046255 & \(1.94\times 10^{-9}\) \\
25 & 0.100987 & 0.001942 & 50 & \(1.55\times 10^{-5}\) & 5.89 \(\times\)\(10^{-10}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: \(p\) value for metric against defect-proneness by Logistic Regression (LR). LR: a two-step logistic regression is widely used in software defect prediction content. The first step is to build univariate logistic regression for each software metric against defect-proneness, and then choose those metrics with significant correlations (\(p\)-value < 0.05).