Introduction

Type 2 diabetes and cancer incidence are increasing worldwide, imposing a great economic, social, and health burden on all people living in rural and urban areas around the globe [1]. In 2012, 32.6 million people were living with cancer worldwide [2]. The global prevalence of diabetes between the age of 20 and 69 years was 8.3 %, corresponding to 837 million people, in 2014 [2]. Patients with diabetes have a higher risk of cancer development and at the same time, higher rates of cancer mortality [3]. Given the substantial burden of both diabetes and cancer and the association between these two conditions, identifying targeted strategies that can simultaneously affect both diseases would reduce a great public health burden. Results of observational epidemiologic studies along with findings from laboratory studies suggest that some anti-diabetic medications could affect cancer risk [3]. In particular, several observational studies suggest a beneficial effect for metformin [48].

Metformin is a biguanide widely used for the treatment of type 2 diabetes [3]. This drug is well tolerated, has a very good safety profile, and is inexpensive. Metformin is the preferred first-line therapy for type 2 diabetes but is also used in combination with other anti-diabetes agents. While the exact mechanism of metformin in diabetes treatment is not entirely clear, metformin treatment has been associated with a reduction in circulating levels of both insulin and glucose in patients with impaired insulin resistance and hyperinsulinemia [3]. The inhibitory effect of metformin on hepatic gluconeogenesis has been described as the main mechanism through which metformin reduces circulating glucose levels [9, 10]. Apart from its anti-diabetic properties, metformin has attracted attention for its in vitro anti-cancer properties, either directly through activation of the AMP-activated protein kinase (AMPK) pathway and inhibition of mammalian target of rapamycin (mTOR) signaling pathway or indirectly by lowering insulin and insulin-like growth factor-1 (IGF-1) [3]. Preclinical studies have reported that metformin exerts its antineoplastic properties through (1) inducing cell cycle arrest in an AMPK-dependent and independent manner, (2) reducing glucose uptake by inhibiting insulin signaling pathway through activating AMPK, and (3) reducing insulin signaling by reducing IGF-1 levels which diminish glucose supply to tumors [4, 1116].

While randomized clinical trials (RCTs) are the ideal study design to assess the effect of metformin on cancer risk, RCTs are not practical to study this for several reasons. Lack of sufficient follow-up time during trial period, confounding due to natural crossovers, treatments required for unanticipated hyperglycemia, and budgetary limitations make RCTs impractical study designs to assess the effect of metformin on cancer risk. In the absence of RCTs, one practical strategy to unveil the effect of metformin on cancer is to take advantage of the pre-existing information on treatment of diabetes gathered longitudinally to conduct observational studies. The availability and richness of administrative databases and electronic medical records have made them attractive resources for such investigations. A large proportion of the observational studies that have used these data have reported a protective effect for metformin in cancer risk. However, the validity of this reported reduction in cancer risk is limited due to several methodological flaws, most importantly time-related biases; immortal time bias and time-window bias [17••, 18, 19]. These methodological shortcomings may lead to overestimation of the beneficial effect of metformin [19].

The objectives of this review are to (1) describe methods (study design and analysis) used to assess the effect of metformin on cancer risk, (2) outline the major methodological challenges in assessing the metformin-cancer association and discuss how these shortcomings can affect the validity of the findings, and (3) summarize the evidence on the effect of metformin on cancer risk from the most valid existing observational studies.

Identification of Relevant Literature

We performed a systematic search for observational (cohort and case-control) studies of metformin and cancer risk published between January 1, 1996 and April 1, 2015. The search was carried out in PubMed using the following main keywords and/or MeSH terms: “metformin,” “biguanide,” “cancer,” “neoplasm,” and “polycystic ovary syndrome”. We also performed a manual search of previously published meta-analyses and systematic reviews on metformin and cancer risk to identify additional relevant publications. The first study on cancer and metformin in human was published in 1995, so we started the search in 1995. To make sure we were not missing any observational studies, we looked for additional relevant studies in the references list of all included studies. We included studies of adults with type 2 diabetes with no pre-existing cancer. For studies with more than one publication, the publication with the largest sample size was selected. Two independent readers reviewed titles and abstracts. Any discordance was resolved through discussion.

Detailed information on the drug use assessment (use versus no use, dose and duration), cancer incidence ascertainment method, study population, study design and methods, and cancer site were abstracted and summarized by members of the research team. Each study was evaluated by at least three team members for the validity of the study design, appropriateness of the analytical methods and presence of major methodological shortcomings. Any disagreement was resolved through discussion. A brief description of common methodological shortcomings assessed in the included studies is provided in Table 1. In addition to the conventional methodologic considerations in observational studies, studies with no time-related biases, no prevalent user bias, and appropriate adjustment for confounding by indication were considered to be at low risk of bias. We summarized findings from low risk of bias studies were summarized separately for case-control and cohort studies.

Table 1 Summary of common methodological issues in observational studies of the association between metformin and cancer risk

Results

A total of 73 eligible studies were identified and included. There were 42 cohort studies and 31 case-control studies published between 1995 and April, 2015. The comparator groups of these studies were composed of other oral anti-diabetics, oral anti-diabetics except thiazolidinones, all other anti-diabetics (including oral and injectable medications), sulphonylureas, thiazolidinones, insulin, diet and exercise, and adults without diabetes. In this review, we focused on the most common methodological issues of the published papers, namely time-related biases, prevalent user bias, and confounding by indication.

Time-Related Biases

Time-related biases, immortal time bias and time-window bias, are common methodological shortcomings of most of the earlier observational studies of metformin and cancer. Failure to account for these two biases has resulted in spurious results supporting a protective effect of metformin on cancer.

Immortal Time Bias

Immortal time bias is a special case of exposure misclassification. Immortal time refers to an initial follow-up time during which the outcome could have not occurred due to the definition of the exposure [17••, 20••]. By misallocating unexposed time as exposed, the event-free person-time will be overestimated among the exposed and the incidence rate of the event will be consequently diluted [17••, 20••]. The exposure definition and time of study initiation are keys in determining immortal time bias. For example, consider a cohort of patients who had diabetes but free from cancer were followed up from the time of diabetes diagnosis. In this case, the time between cohort entry and the first prescription for metformin is considered immortal time since by the virtue of the study design, metformin users could not have had cancer during that period (Fig. 1a). As another example, consider a cohort of patients with diabetes followed up from the time they start their first prescription for a diabetes medication. Medication use was defined as the second prescription of metformin or its comparator to avoid inclusion of non-adherent users to the study. Thus, the time between the first and the second prescription is immortal time (Fig. 1b). In both scenarios, metformin users were not exposed to metformin during these periods and as a result could not have experienced cancer. Failure to attribute this immortal person-period to the non-metformin user group either through misallocating this person-period to metformin users or simply excluding this person-period from the calculations will result in a lower incidence of cancer among metformin users and a consequent beneficial effect for this drug [21]. Lai et al. used data from the National Health Insurance Program in Taiwan to assess the effect of anti-diabetic drugs on cancer risk. The investigators identified adults newly diagnosed with diabetes and looked at anti-diabetic medications within this cohort. The study reported a 45 % (95 % CI, 18, 63 %) reduction in lung cancer risk with metformin use compared to non-users of metformin. However, at the time of cohort enrollment, participants were not using anti-diabetic drugs. Exposure to anti-diabetic drugs, including metformin, occurred after the start of the study. By including the period between study initiation and start of medication, i.e., immortal person-time, the event-free person times in the anti-diabetes medication groups were overestimated, resulting in an underestimation of the true effect of metformin on cancer [22].

Fig. 1
figure 1

Immortal time bias in cohort studies. Each dot represents one prescription. The blue circle represents the end of the study, loss to follow-up or cancer occurrence. a Comparing metformin users to non-users. Exposure to metformin occurs after the start of the follow-up, i.e., exposure occurs after the initiation of the study. b The exposure is defined as the second prescription of metformin. The time between the first and the second prescription is considered immortal person time

The magnitude of immortal time bias depends on the extent of immortal time, the risk of the outcome during that period, and the prevalence of exposure [17••]. Thus, in the context of a very common drug such as metformin, one can speculate that even a small amount of immortal time for each individual can lead to a large degree of bias [17••]. Different methods have been proposed to overcome immortal time bias in observational studies. Both Zhou et al. and Levesque et al. compared the performance of different methods in correcting for immortal time bias and concluded that using a time-matched nested analysis (see next section) and time-dependent exposure analysis had the best performance in controlling for immortal time bias [23, 24]. However, the validity of the results from the time-dependent Cox proportional models is questionable. When using time-dependent Cox proportional models, it is inherently assumed that metformin assignment occurs at random, which may not be the case. Using time-dependent Cox models and assigning the immortal time periods of metformin users to non-users to handle bias related to immortal person time has been shown to introduce substantial bias with inflated effect sizes [19, 25, 26].

Ray et al. suggested a new-user design by moving the start of the follow-up to the time of drug initiation, i.e., end of immortal time [27]. This design is free of immortal time among users. A cohort of participants with a well-defined start of drug initiation, i.e., a new-user design, is an appropriate approach to evaluate the effect of metformin over time. By definition, a new-user design is free of immortal time bias as the follow-up period initiates with the first date patients start taking their medication. Mamtani et al. conducted a retrospective cohort study within The Health Improvement Network (THIN), an electronic medical records database that is representative of the UK. They identified patients with diabetes who were ever-users of metformin or ever-users of sulfonylureas, and compared incidence rates of bladder cancer between ever metformin and ever sulfonylurea users. Exposure to metformin and sulfonylurea was based on receipt of two prescriptions of either drugs or medications that contained those drugs within 6 months. This design helped ensure that those non-adherent to medication were less likely to be included compared to adherent patients. By defining the index date as the date of receiving the second prescription, immortal time bias was avoided. After properly accounting for time-related biases in the study design, the authors did not observe a decreased incidence of bladder cancer associated with metformin use [28].

Time-Window Bias

Time-window bias is another time-related bias in observational studies of metformin and cancer that has resulted in the false conclusion that metformin reduces cancer risk [17••, 18]. Time-window bias usually occurs in case-control studies when exposure measurement periods (duration of time for potential exposure) differ for cases and controls (Fig. 2). Control selection and exposure measurement methods in controls give rise to this bias [18]. Neglecting time for potential to be exposed while selecting controls might lead to a differential likelihood of being exposed to metformin compared to cases. In the presence of this bias, cases could have less follow-up time and therefore receive fewer metformin prescriptions compared to controls; alternatively, cases could have longer follow-up period and therefore more metformin prescriptions compared to controls. Unlike immortal time bias, the direction of time-window bias is not predictable a-priori. The direction of bias depends on the differential distribution of the exposure assessment between the two groups [18]. In their case-control study of metformin and/or thiazolidinediones (TZDs) and lung cancer, Mazzone et al. randomly selected controls from persons with diabetes who were free of lung cancer and individually matched them for age (+/−5 years), sex, and smoking history. Medication records were extracted from the electronic medical record of the Cleveland Clinic Health System. They reported a 52 % reduction in likelihood of lung cancer associated with metformin use. Their result, however, was subject to time-window bias due to differential assessment of metformin exposure in lung cancer cases and controls. Cases and controls were not matched on the duration of metformin assessment and therefore the potential exposure time to metformin was not the same in both groups. Exposure to metformin in lung cancer cases was measured until they were diagnosed. Controls, however, could have been assessed for metformin use any time before and after lung cancer diagnosis in their matched lung cancer cases. As a result, they had a higher likelihood of being exposed to metformin compared to lung cancer cases [29].

Fig. 2
figure 2

Time-window bias in case-control studies. The blue circles represent the end of the follow-up period for controls and the crosses represent cancer occurrence for cases. The orange circles represent first prescription of metformin. The follow-up duration was longer in controls compared to cases and resulting in a higher likelihood of being exposed to metformin compared to cases

To avoid time-window bias, one should consider the time-dependent nature of metformin use and select controls such that cases and controls have the equivalent follow-up time during which metformin exposure will be assessed [17••, 18]. Adapting a nested design where controls are selected for each case when a case occurs or exposure is assessed for a control at the same time it is assessed for their matched case are some proposed methods [17••, 18]. Smiechowski et al. used data from the UK General Practice Database to assess the incidence of lung cancer associated with metformin use. Within a defined cohort of patients with diabetes newly treated with oral hypoglycemic agents between 1988 and 2009, they conducted a nested case-control study. The investigators matched lung cancer cases and controls on duration of follow-up to ensure that cases and controls had the same duration of exposure assessment, thus avoiding time-window bias. Unlike Mazzone et al., Smiechowski et al. did not find a significant association between metformin and incident lung cancer [30].

Prevalent User Bias

The use of prevalent metformin information in the design and analysis of observational studies will introduce prevalent user bias [19]. Overall, inclusion of prevalent users can introduce two biases: (1) prevalent users are survivors of the early phase of therapy and therefore constitute a “survivor cohort” who constitutes a generally healthier group of patients. On the other hand, this design leads to under-ascertainment of the events that occur early during the disease course. Since the more susceptible individuals, i.e., those who have experienced events earlier, are not included in the prevalent user design, this cohort is more likely to experience an additional biased survival benefit, and (2) prevalent use of the drug is likely to alter the levels of the risk factors. Thus, they might not necessarily be a reflection of clinical outcomes of the disease anymore. In such circumstances, controlling for the confounding effect of these risk factors would be complicated as these factors are affected by treatment and are on the causal pathway from the exposure to the outcome [19, 20••]. In a hypothetical example, obesity has been linked to increased cancer risk through several mechanisms, some of which, including insulin, IGF-1, mTOR, and AMPK, are directly impacted by metformin. Additionally, because of its potential weight loss properties, metformin may be selected over other medication classes for obese patients. In an observational setting with prevalent use of metformin, obesity rates may be lower and as a result, obesity cannot be considered as a risk factor for cancer in this setting.

Identifying a cohort of new users and collecting data prior to the initiation of the study is an effective method to avoid prevalent user bias, especially when the drug effect changes over time. The new user design can be implemented in a nested case-control or a cohort setting. Although a new user design can eliminate the biases associated with inclusion of prevalent users, this study design has its own limitations and logistical issues. Compared to prevalent users, a new user design might have an overrepresentation of poor adherers and short-term users. By restricting the study to new users, statistical power will also be limited. Finally, logistical considerations on the timing of data collection (both drug and other covariates) are another concern with new-user design [27]. One important consideration in the design of new-user study is the timing of medication initiation and measurement of other covariates/potential confounders at or prior to the start of the medication. This requires extensive resources as the investigators are required to monitor the exposure’s and the other covariates’ status on a daily basis [27].

Confounding by Indication

Metformin is used as first-line pharmacotherapy for diabetes and as such, is usually initiated in patients at younger ages or patients who are at earlier stages of diabetes [3, 31]. Other diabetes medications are usually prescribed if metformin is not tolerated (or contraindicated), if metformin does not provide sufficient glycemic control and according to other patient-specific factors such as complications and co-morbid conditions and preferences related to side effects, frequency of dosing, etc. [19, 20••]. These patient-specific factors which determine the diabetes regimen are also associated with outcomes whose risk is increased among patients with diabetes, such as cardiovascular disease and cancer. The unbalanced distribution of risk factors between users of different diabetes medications leads to a biased association between drugs and outcomes (e.g., cancer), namely, confounding by indication [19].

Therefore, comparing metformin users to patients treated with second- or third-line diabetes agents likely introduces confounding by indication when evaluating the association between metformin and cancer risk as patients requiring a second- or third-line drug likely have a longer disease duration (and exposure to hyperglycemia and hyperinsulinemia) which increases their cancer risk.

Confounding by indication is an intractable threat to validity, and if not accounted for in studies of the association between metformin and cancer, it can lead to conflicting results [32]. The first step in controlling for confounding by indication is defining an appropriate comparator group so that distribution of the risk factors is balanced between the two groups. In the absence of randomization, one can use restriction as a powerful alternative to control for confounding and restrict the population to those with the same drug indication [20••]. Upon identification of a proper comparator group, different strategies at the design or the analysis level can be implemented to further reduce confounding. One effective strategy to further control for all potential confounding is to use propensity scores. This method is especially effective when the outcome is uncommon and the number of measured covariates is large, a common scenario with large healthcare datasets. The propensity score is an important tool which incorporates all of the covariates into one score and represents the probability of receiving one treatment over the other given all of the potential confounders in the study. This method aims to achieve balance between the study groups with regard to measured confounders, similar to what happens in a randomized trial. The achieved balance can be checked by comparing the covariates’ distribution between the treatment groups before and after applying propensity score methods. A lack of balance after propensity score matching is an indication of the inadequacy of the data for answering the question of interest as opposed to a limitation of the method [20••, 32].

Some of the comparator groups in studies of metformin and cancer risk included the following: use of any anti-diabetic drug including insulin [7, 33] and sulfonylureas [7, 3436], use of only oral anti-diabetic drugs [6, 30, 37], no use of anti-diabetics therapy [38], and combinations of the above categories. A comparator group composed of a mixed group of diabetes patients receiving second- and third-line therapies and/or a combination of different medications is most likely at higher cancer risk compared to metformin users due to the greater severity and duration of their diabetes and potentially greater burden of oncogenic comorbidities. In these studies, inclusion in the metformin or comparator group might in fact explain the reported association between metformin and cancer. Currie et al. used information from people treated in UK general practices who were participating in The Health Information Network (THIN). They categorized 62,809 individuals with diabetes who had received oral anti-diabetic medications into four groups: monotherapy with metformin, monotherapy with sulfonylurea, combination therapy with both drugs, and insulin. The study reported an increased risk for cancer comparing other therapies with metformin monotherapy; the adjusted HR was 1.08 (95 % CI 0.96–1.21) for metformin plus sulfonylurea, 1.36 (95 % CI 1.19–1.54) for sulfonylurea monotherapy, and 1.42 (95 % CI 1.27–1.60) for insulin-based regimens. Comparing first-line therapy and second- or third-line therapy introduced confounding by disease duration and severity, and confounding by indication. The increased risk of cancer with second- and third-line therapy is likely to be due to disease indication and not medication effects [7]. Van Staa et al. used data from the General Practice Research Database to evaluate comparability of users of different hypoglycemic agents with respect to their underlying cancer risk, i.e., presence of confounding by indication. They hypothesized that in the absence of confounding by indication, the cancer rate should be similar across all groups shortly after initiation of therapy, as it would take several months before the effect of the drugs on cancer risk is clinically noticeable. Van Staa and his colleagues did observe increased rates of cancer during the first 3 months after initiation of insulin and sulfonylurea compared to metformin, revealing confounding by indication [39•].

Like metformin, sulfonylurea is one of the initial choices for treatment of type 2 diabetes. To reduce confounding by indication, Ko et al. chose new sulfonylurea users as the comparator in assessing the effect of metformin in new users on endometrial cancer risk. They further used propensity score methods to adjust for residual confounding. The authors used data from the Truven Health Analytics MarketScan and Medicare Supplemental databases for 2000–2011 and identified women above 18 years old who initiated metformin or sulfonylurea and followed them from their second prescription of their initial drug until cancer development, cessation of either drug, cross over, administrative censoring, or the end of the study. They identified baseline characteristics during the 6-month washout period before the study initiation and further used propensity score weighting to adjust for confounding. Assessment of covariates 6 months before study initiation ensured appropriate sequencing of the events and that the identified covariates were not intermediate variables affected by the exposure. In this study, metformin was not associated with a decrease in endometrial cancer incidence compared to sulfonylurea (HR (95 % CI) 1.09 (0.89, 1.34)) [34].

Review of the Available Literature

From the 73 included studies, we identified 29 studies with no time-related biases. Considering all the three major biases (time-related bias, prevalent user bias, and confounding by indication), we classified seven cohort studies and six case-control studies as studies at low risk of bias to evaluate the association between metformin and cancer risk [6, 28, 30, 3437, 4045]. Figures 3 and 4 summarize the identified cohort and case-control studies and their risk estimates. As shown in the figures, most of these low risks of bias studies showed no association between metformin and cancer risk.

Fig. 3
figure 3

Summary of the low risk of bias cohort studies conducted between January 2005 and April 2015 [28, 3436, 4042]. HR hazard ratio. Sulfonylurea was the comparator for most of the studies except for But et al., Tsilidis et al., Mamtani et al. and two of the comparisons in Kowal et al. *Comparator: no anti-diabetic medication use.**Comparator: insulin. ****Comparator: other anti-diabetic medications. ^Comparator: non-users of metformin

Fig. 4
figure 4

Summary of low risk of bias case-control studies conducted between January 2005 and April 2015 [6, 30, 37, 4345]. OR odds ratio, RR relative risk. *Included users of other anti-diabetes medications in both arms. **Reported OR as a measure of association

Other Considerations

Some of the other methodological considerations besides the major biases discussed above include but are not limited to generalizability, lack of power, exposure assessment, and drug exposure level.

Generalizability

Most of the studies on metformin and cancer risk have been conducted among patients with diabetes. The effect of metformin in the general population may different from the effect observed in patients with diabetes. Results of animal studies have shown that metformin inhibits tumor growth in mice on a high-energy diet, while it has no effect on tumor growth in mice with a controlled diet [4]. This observation suggests that the effect of metformin among patients with diabetes with elevated insulin receptor activation might not be generalizable to the general population with normal insulin receptor function [4, 15].

Exposure definition

So far, exposure definition in studies of anti-diabetic medications and cancer has received little attention [46]. Most of the studies on metformin and cancer risk have used a simple binary categorization and classified metformin exposure into users and non-users. While the use of an arbitrary cut-point for dichotomizing patients into users and non-users of metformin is straightforward and common, it has drawbacks. For some of the studies that have used this binary categorization, the cut-off is made at the diagnosis of diabetes. Inappropriate exposure definition leads to misrepresentation of exposure duration and thus immortal time bias.

Even when the timing of the exposure is properly defined, one should always bear in mind that this simple binary representation, although informative, does not capture and reflect all the available information on drug exposure. By adapting this approach, the dimension of time and duration of drug use would be underestimated in the analysis of drug exposure and cancer risk, such that long- and short-term users would be grouped together and the estimated treatment effect would not necessarily reflect a valid estimate of the drug effect. Incorporating information on duration, cumulative dose, and continuity of drug use where available could give a more in-depth understanding of the true nature of this association [46].

Conclusions

In an era when there is a strong push towards repurposing inexpensive licensed drugs for cancer prevention and treatment, metformin comes to the forefront as one of the most commonly prescribed candidates with great potential, based on previously conducted observational studies and meta-analyses and the promising results from animal and laboratory studies [31, 47]. Determining the effect of metformin on cancer risk in humans depends on the availability of valid data sources with complete information on confounders, accurate assessment of drug use, appropriate study design, and robust analytical techniques. Confounding by indication and disease severity, inclusion of prevalent anti-diabetic drug users, inclusion of or inappropriately addressing immortal-time bias in the analysis and time-window bias are likely to be responsible for the currently-debatable effect of metformin on cancer risk. Different drug exposure level seems to be responsible for the inconsistency between laboratory and human studies. The dose of metformin used in animal and laboratory studies is considerably higher compared to the currently standard clinical dose. The in vitro dose reported in various studies ranges between 165 and 6600 mg/L, while the feasible therapeutic plasma level is 0.645 to 2.5 mg/L. This indicates that while an anti-cancer effect for metformin is plausible, the required concentration for such an effect might be orders of magnitude higher than what is used in humans [47]. In the absence of clinical trials, unravelling the true effect of metformin on cancer risk in observational studies requires the use of validated datasets, rigorous study design, and analytic methods capable of addressing all three major biases. Comparing metformin users to diabetic patients with similar drug indications and further adjusting for confounding using propensity score methodology can reduce confounding by indication. Adapting a new-user design ensures that only incident users of metformin and their comparators are enrolled into a study can avoid prevalent user bias. Immortal-time bias should also be taken into account by design so that exposure time begins once patients are exposed to medications.

We show that the majority of the observational studies assessing the association between metformin and cancer risk suffer from methodological shortcomings, and efforts to address these issues have been incomplete. Future investigations on the association between metformin and cancer risk should clearly address the methodological issues due to confounding by indication, prevalent user bias, and time-related biases. Although the proposed strategies do not guarantee a bias-free estimate for the association between metformin and cancer, they will reduce synthesis and reporting of erroneous results.

This review sets up a framework for future observational studies that aim to assess new indications for drugs that have already been widely adopted by emphasizing how methodological shortcomings affect the validity of findings. By increasing the current understanding of biases and threats to validity and evidence generation in observational studies and the available strategies to minimize them, we hope to contribute to the generation of robust evidence on the true effect of metformin on cancer incidence. Using the effect of metformin on cancer incidence as an example, we set up the basis for all similar studies that looked at benefits and harms of anti-diabetes medications in EMR and claim data. The proposed harmful effect of insulin glargine and thiazolidone on cancer incidence and the effect of different anti-hyperglycemic drugs on cardiovascular diseases can now be evaluated in EMR data with robust methodology. Finally, this work will also set up a framework for all similar studies of drug repurposing using EMR data in diabetes, cancer, and other fields.