# MGHT: Statistical Methodology for Missing-Data Imputation in Food Composition Databases
## 4 Discussion  
To compare our methodology with current state-of-the-art approaches for obtaining missing values in data tables, we decided to compare MIGHT with NMF. To apply the NMF algorithm we used the \"NNLM\" (Non-Negative Linear Models) [56] package for the R programming language. This implements fast sequential coordinate descent algorithms for non-negative linear regression and NMF. It is used for fast and versatile NMF. In this case, we used the previous example of Potassium (K) values in the food group \"Fruits\". The algorithm works on the whole set, i.e., table, and can obtain multiple missing data. To make a fair comparison of the algorithm, we apply it when there is only one missing data value. The data are looped and in each step of the loop one value is set as \"NA\", which implies a missing value, and then the NMF algorithm is applied on the whole set. The error is calculated by comparing the obtained value from the algorithm and the actual value. After the application of the algorithm, the missing value is calculated. At the end of the loop, all the data have gone through that process and what is left is to compare the calculated values with the actual values and to calculate the absolute error values for each one. When this has been done, the results from this method are compared with the results obtained from our methodology. The results of the comparison are presented in Table 11 when All vs. all post-hoc type procedure (MIGHTv1) is used, and in Table 12 when One vs. all post-hoc type procedure (MIGHTv2) is used. The comparison shows that our methodology gives smaller error in around 60% of the cases on average and wins over the current state-of-the-art methodology for any type of missing values in datasets. These results are very promising. The NMF has an advantage that it can be applied to a dataset that has many missing values. Of course, as the number of missing data increases, the precision of the calculated values will decrease. Regarding the time complexity of MIGHT, in Table 13, the execution times for obtaining the rules for all the use cases are presented. This time was calculated using a computer with a 4-core _i5_ central processing unit that runs with a clock rate of 2.6 GHz. The datasets from each use case are with the following dimensions: \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Median** & **MIGHTv1** & **MIGHTv2** & **Regular** \\ \hline MIGHTv1 & / & \(9.82\times 10^{-1}\) & \(3.08\times 10^{-3}\) \\ MIGHTv2 & \(9.82\times 10^{-1}\) & / & \(5.61\times 10^{-3}\) \\ Regular & \(3.08\times 10^{-3}\) & \(5.61\times 10^{-3}\) & / \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Results from Nemenyi post-hoc test for UK obtained by using MIGHTv1 with median, MIGHTv2 with median, and regular median. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Use Case/Measure** & **Average** & **Median** \\ \hline Potassium (K) in Fruits & 58.4\% & 57.9\% \\ Sodium (Na) in Fruits & 55.8\% & 52.8\% \\ Sodium (Na) in Vegetables & 52.7\% & 58.0\% \\ Protein (PROT) in Meats & 50.9\% & 52.8\% \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Percentage of cases when MIGHTv1 gives smaller error than non-negative matrix factorization. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Use Case/Measure** & **Average** & **Median** \\ \hline Potassium (K) in Fruits & 58.6\% & 55.8\% \\ Sodium (Na) in Fruits & 59.3\% & 66.3\% \\ Sodium (Na) in Vegetables & 66.0\% & 69.3\% \\ Protein (PROT) in Meats & 59.6\% & 62.1\% \\ \hline \hline \end{tabular}
\end{table} 
Table 12: Percentage of cases when MIGHTv2 gives smaller error than non-negative matrix factorization. * Potassium (K) in Fruits -- 16 \(\times\) 9;
* Sodium (Na) in Fruits --16 \(\times\) 9;
* Sodium (Na) in Vegetables --15 \(\times\) 9; and
* Protein (PROT) in Meat --13 \(\times\) 9. In addition, we explored cases where MIGHT gives the greatest absolute error. Such case was obtained for the use case of Sodium (Na) in Vegetables for the food Spinach.