# Network Theory and Switching Behaviors: A User Guide for Analyzing Electronic Records Databases
## 1 Introduction
### The Importance of Investigating Drug-Switching Behaviors  
After a physician consultation, the patient usually receives a treatment plan (e.g., drug prescriptions, dietary habits, performing or avoiding physical activities). However, the patient may or may not follow medical advice. The term compliance (also called adherence) refers to behavior in which the patient follows the physician's instructions. Compliance becomes critical in the case of chronic illness medication, where the patient must take a specific drug (or different drugs in sequence) for a prolonged interval of time. There is no way for the physician to directly ascertain the compliance of the patient. However, drugs consumption can be inferred from administrative and medical databases, and although the prescription of a drug does not necessarily correspond to the consumption of that drug, it can be considered a good indicator [5; 20; 21; 22]. It is worth noting that statistical analysis of these kinds of databases is not straightforward because they are commonly characterized by records of tens of thousands of people (or more) for several years. A row is created when a new event related to a patient occurs (e.g., a new prescription, an update about a new medical condition). Table 1 reports a simplified extract of a few lines of a typical database. Following previous contributions [12; 23], here, we will focus on a specific issue that can answer questions such as, \"Given a certain drug, what are the other drugs with which a switch is more likely?\". This is an example of switching behavior, which is particularly important within health literature [24; 25; 26]. Under certain circumstances, a physician may ask a patient to switch medication. For example, within the psychiatric field, \begin{table}
\begin{tabular}{c c c} \hline \hline
**ID** & **DATE** & **CODE** \\ \hline
1002 & 12/10/2020 & 1 \\
2043 & 12/10/2020 & 1 \\
2005 & 12/10/2020 & 2 \\
1002 & 13/10/2020 & 3 \\
4345 & 13/10/2020 & 1 \\... &... &... \\ \hline \hline \end{tabular}
\end{table} 
Table 1: An illustrative example of a health records database. there are circumstances (especially for patients who require long-term treatment) where switching the current antipsychotic medication to another antipsychotic drug is required because adverse effects were observed or the response to treatment is inadequate [27]. Information about how prescriptions of various drugs change in sequence is stored in the aforementioned databases. Thus, their analysis may contribute to ascertaining what kind of switch pattern is associated with the best clinical outcome (reduction of adverse effects and optimal clinical response). Investigating drug-switching patterns is a critical aspect also in the domain of behavior change interventions [28; 29; 30; 31]. In order to obtain the best clinical outcome, patients have to switch drugs in the way prescribed by the physician. The adherence to physician's guidelines depends on several variables (e.g., intentions, beliefs, habits, motivation). Traditionally, health psychology has proposed several theoretical models to design behavior change interventions that can help to improve adherence [32; 33]. More recently, cognitive-oriented forms of interventions have been proposed. Exploiting the sensitivity to the context of cognitive processes [34; 35; 36; 37; 38] and, in particular, decision making [39; 40; 41; 42], the so-called \"Nudge approach\" proposes changing the architecture of choice (i.e., the design in which choices are presented to decision makers) in order to obtain nonforced compliance [43]. The Nudge theory is based on indirect suggestions and default behavior. In other terms, the context in which a certain choice is made is organized in order to induce automatic and effortless behaviors [44; 45; 46; 47] that are associated with better adherence.