# Network Theory and Switching Behaviors: A User Guide for Analyzing Electronic Records Databases
## 5 Discussion and Conclusions  
This paper aimed to promote the use of network theory as a method to investigate switching behaviors (in particular, drug switching). The current and shared approach is usually based on classical statistical analyses (to compare individuals who have switched in a given period with those who have not switched) [51; 61; 62]. However, this approach is unable to grasp the real complexity and switching pattern that a health database may contain. Network theory may represent a useful tool for analyzing switching behavior for healthcare researchers. In this contribution, we reported a brief list of network theory fundamental concepts, a Python script that allows obtaining an adjacency matrix from the basic information of a healthcare database and an illustrative example of the application of graph analysis. Focusing only on the analysis of an unweighted directed adjacency matrix, it was possible to see how network theory indexes can be very informative about the switching pattern about drugs. Indeed, in some cases, it may be observed a fully connected network, whereas in other cases, the database analysis could reveal a situation more similar to the reported Case Study where some drugs play a more central role in switching patterns compared to other more peripheral. Here, we focused on a basic analysis in order to propose to healthcare researchers a ready-to-use guide to get started. However, compared to the simple analyses presented in this paper, it could be useful to integrate them with the computation of indexes based on the weights of the adjacency matrix [53; 54]. Indeed, the Python script reported in this paper produces a weighted matrix, and the weights can allow obtaining useful insight about switching behaviors. Typically, the highest weights are found in correspondence to switches towards the same drug [20]. However, with regard to the switch from one drug to another, it could be useful to differentiate which kind of switch is more frequent. The importance of also taking into account the weight between nodes is testified by studies that observed how weighted networks are successful in simulating real-world networks [63; 64]. The use of an adjacency matrix opens also the possibility to employ clustering algorithms [65; 66]. Clustering allows dividing the whole sample of nodes into subsamples that maximize intracluster similarities and intercluster sparsity. In other terms, the basic idea is that the nodes in the same cluster are closer to each other than the nodes in other clusters. Thus, this analysis can allow detecting subsets of drugs that tend to switch to each other. The use of network theory to analyze drug switching may allow obtaining deeper insights about patients' behaviors and their health compared to current approaches. Determining what kind of drug-switching pattern is associated with the best outcome or if there is no difference in health outcomes when switching between branded and nonbranded drugs may result in beneficial effects in terms of well-being and financial sustainability of the healthcare system. This paper is focused on drug switching as a peculiar example of information taken by health records databases, but it is important to note that this approach can be generalized to other health-related behaviors (e.g., the consumption of water with different amounts of calcium [67], the investigation of the influence of nudging strategies to different health behaviors [68] or the study of placebo/nocobo effects [69; 70]). Every behavior or event automatically recorded in a database that can be switched is of course amenable to the proposed approach. We hope that this contribution may represent a user guide to improve the investigation of switching behavior inferred from health records databases through the deployment of network theory. **Author Contributions:** Conceptualization, G.G. and F.G.; formal analysis, G.G. ; methodology, G.G., F.G. and M.R. ; software development, M.R. ; writing--original draft preparation, G.G. ; writing--review and editing, F.G. and M.R.