#Load packages

library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.2.2
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ ggplot2 3.3.6     ✔ purrr   0.3.4
## ✔ tibble  3.2.1     ✔ dplyr   1.1.2
## ✔ tidyr   1.2.0     ✔ stringr 1.4.0
## ✔ readr   2.1.2     ✔ forcats 1.0.0
## Warning: package 'tibble' was built under R version 4.2.3
## Warning: package 'readr' was built under R version 4.2.1
## Warning: package 'dplyr' was built under R version 4.2.3
## Warning: package 'forcats' was built under R version 4.2.3
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library(gtsummary)
## Warning: package 'gtsummary' was built under R version 4.2.3
library(corrplot)
## Warning: package 'corrplot' was built under R version 4.2.3
## corrplot 0.92 loaded
library(splines)

Introduction

Diabetes mellitus (DM)-related readmissions occur frequently in patients with DM. Thirty-day readmission rate is used as a parameter for cost control and quality of care improvement Soh JGS, Mukhopadhyay A, Mohankumar B, Quek SC, Tai BC. Predicting and Validating 30-day Hospital Readmission in Adults With Diabetes Whose Index Admission Is Diabetes-related. J Clin Endocrinol Metab. 2022 Sep 28;107(10):2865-2873. Identification of factors that increase probability of 30-day readmission can help to identify patients with greater risk, who need specific care. Moreover, in case these factors are modifiable these can be targeted via interventions to further improve care for these patients.

The objective of the following analysis is to identify predictors of 30 day-readmission among patients with DM.

Methods

Data set used was prepared by Beata Strack et al Beata Strack, Jonathan P. DeShazo, Chris Gennings, Juan L. Olmo, Sebastian Ventura, Krzysztof J. Cios, and John N. Clore, “Impact of HbA1c Measurement on Hospital Readmission #Rates: Analysis of 70,000 Clinical Database Patient Records,” BioMed Research #International, vol. 2014, Article ID 781670 and it was downloaded from Diabetic Patients’ Re-admission Prediction, together with coding list. In brief, data comes from the Health Facts database (Cerner Corporation, Kansas City, MO), a national data warehouse that collects comprehensive clinical records across hospitals throughout the United States. The extracted data represent 10 years (1999–2008) of clinical care at 130 hospitals and refer to hospital admissions of diabetic patients, in whom the length of stay was at least 1 day and at most 14 days, laboratory tests were performed and medications were administered during the hospital admission. Totally, 101,766 encounters were identified with 55 features describing patient demographics, information about patient´s previous hospital admissions, emergency and outpatient visits, number of diagnoses, laboratory procedures, medications and whether test for blood glucose was performed (either HbA1C or blood glycaemia). The data set also includes information on diabetic medications prescribed and generally, whether there was any change in the dose or product (this is not further specified).

Variables

Response variable - readmission within 30 days is a response variable (“readmitted”) which is used for patients being readmitted within 30 days of discharge. Independent variables include demographic data (race, age group, gender), medical history - primary diagnosis, number of laboratory tests performed during the encounter, number of distinct generic names administered during the encounter, number of outpatient, emergency and inpatient visits of the patient in the year preceding the encounter, number of diagnoses entered to the system, time in hospital, glycaemia test (HbA1C, blood glucose) and antidiabetic medicines prescribed (see below).

Data manipulation

Outside this document, data manipulation was performed to make data more logistic regression friendly. Readmission within 30 days is a response variable (“readmitted”). The other two values (readmission after 30 days or no readmission) are grouped together in the category “not readmitted”. This is in line with the above mentioned paper by Beata Strack et al all. Hospital admissions with death in the discharge information were excluded. Moreover, in line with the Beata Strack et al all, age was further categorized into the 3 groups (“30 and younger”, “30-60 years old” and “60-100 years old”). Diabetes medications were further grouped into pharmacotherapeutic groups describing pharmacological therapy of DM patients. This resulted in the following variables: “metformin”, “insulin”, “glinides” (stands for meglitinides), “acarbose” (comprising also miglitol reflecting similar mechanism of action, “acarbose” group stands for α-Glucosidase inhibitors), “sulphonylureas”, “glitazones” (stands for thiazolidinediones) and a new variable - “combination” - was made from existing variables (“metformin-rosiglitazone”,“metformin-pioglitazone”, “glimepiride-pioglitazone”, “metformin-glyburide” and “glimepiride-pioglitazone”) due to few counts in each group. For the group - information whether a patient was/was not exposed is recorded. “Yes” - being exposed equals to values describing change in medication, i.e. values: “Steady”, “Up”, “Down” and being not exposed was assigned to all the encounters with value “No”. Test for hyperglycemia was coded as follows - test done and glycaemia in the norm (“Norm”), test done and hyperglycemia observed (“High”), no test done (“No”). Primary diagnosis was defined according to the table 2 in the Beata Strack et al all, resulting in the list of diagnoses groups - Circulatory, Respiratory, Digestive, Diabetes,Injury, Musculoskeletal and Genitourinary disorders, Neoplasms and Others. Complete list of variables and exact definition for primary diagnosis categories can be seen in the paper.

Variables - summary measures

Continuous data is summarized using descriptive statistics (mean, 1st quartile, median, 3rd quartile, minimum and maximum), categorical data is described by frequency.

Missing data

Variables with >5% of missing data are excluded from the analysis as the most conservative approach. Therefore, following values were excluded - weight (97% of missing values), payer code (52% of missing values) and medical specialty (53% of missing values). Following investigation of pattern of missing data - admission type id - was also removed (11% missing values). Variables with up to 5% of missing data were imputed with MICE package (using predictive mean matching algorithm for data imputation) - this was done for variables: “race” and “gender”.

Statistical analysis

Patients that have been readmitted were compared to those who were not readmitted using Chi-square test and Wilcoxon rank sum test or Fisher exact test if the criteria for Chi-square test were not fulfilled. Further, assumptions for logistic regression were checked (outliers, collinearity and linearity assumption). Independency of observations and random sampling is assumed to be met. To test linearity assumption between logit and numeric predictors, Box-Tidwell test was used. When linearity assumption is not met, natural cubic splines or variable transformation (or categorization as the last option) were used. To determine independent predictors of hospital readmission, at first simple logistic regression models with individual predictors were performed. Multiple logistic regression model included all significant variables from these individual models. Pairwise interactions were added into the core model to investigate multiplicative effects of variables included. Specifically, effects of number of inpatient stays in the previous year (as a surrogate for seriousness of patient´s underlying condition) with age category and primary diagnoses were added. Moreover, multiplicative effect of drug combinations with insulin were tested (as these combinations indicate worse DM and potentially risk of serious hypoglycaemia). As the analysis is focused on establishing association rather than prediction, model diagnostics in terms of prediction is not performed. Data was analysed with R software (R version 4.2.0). The significance level was determined by a p<0.05 (2-sided test).

Loading data

DM<-read_csv(file=here::here("data","DM.csv"))
## Rows: 100114 Columns: 22
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (14): race, gender, age_cat, primary_diagnosis, insulin, Diabetesmed, gl...
## dbl  (8): time_in_hospital, num_lab_procedures, num_medications, number_outp...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
DM[sapply(DM, is.character)] <- lapply(DM[sapply(DM, is.character)],as.factor)

Exploratory analysis

Descriptive statistics of study patients

summary(DM)
##               race       gender           age_cat      time_in_hospital
##  AfricanAmerican:19302   F:53862   30-60 years:30493   Min.   : 1.00   
##  Asian          :  639   M:46252   up to 100  :67121   1st Qu.: 2.00   
##  Caucasian      :76557             up to 30   : 2500   Median : 4.00   
##  Hispanic       : 2084                                 Mean   : 4.39   
##  Other          : 1532                                 3rd Qu.: 6.00   
##                                                        Max.   :14.00   
##                                                                        
##  num_lab_procedures num_medications number_outpatient number_emergency 
##  Min.   :  1.00     Min.   : 1.00   Min.   : 0.0000   Min.   : 0.0000  
##  1st Qu.: 31.00     1st Qu.:10.00   1st Qu.: 0.0000   1st Qu.: 0.0000  
##  Median : 44.00     Median :15.00   Median : 0.0000   Median : 0.0000  
##  Mean   : 42.94     Mean   :15.98   Mean   : 0.3694   Mean   : 0.1983  
##  3rd Qu.: 57.00     3rd Qu.:20.00   3rd Qu.: 0.0000   3rd Qu.: 0.0000  
##  Max.   :132.00     Max.   :81.00   Max.   :42.0000   Max.   :76.0000  
##                                                                        
##  number_inpatient  number_diagnoses       primary_diagnosis insulin    
##  Min.   : 0.0000   Min.   : 1.000   Circulatory    :30672   NO :46680  
##  1st Qu.: 0.0000   1st Qu.: 6.000   Injury         :20571   Yes:53434  
##  Median : 0.0000   Median : 8.000   Respiratory    :14998              
##  Mean   : 0.6328   Mean   : 7.409   Digestive      :11576              
##  3rd Qu.: 1.0000   3rd Qu.: 9.000   Diabetes       : 8693              
##  Max.   :21.0000   Max.   :16.000   Musculosceletal: 4990              
##                                     (Other)        : 8614              
##  Diabetesmed   readmitted     gluc_test    metformin   glinids    
##  No :22842   Min.   :0.0000   High:14408   No :80216   No :97901  
##  Yes:77272   1st Qu.:0.0000   No  :78309   Yes:19898   Yes: 2213  
##              Median :0.0000   Norm: 7397                          
##              Mean   :0.1134                                       
##              3rd Qu.:0.0000                                       
##              Max.   :1.0000                                       
##                                                                   
##  sulphonylureas glitazones  acarbose    change      combination
##  No :72027      No :86547   No :99770   No :53671   NO :99402  
##  Yes:28087      Yes:13567   Yes:  344   Yes:46443   YES:  712  
##                                                                
##                                                                
##                                                                
##                                                                
## 

The data set involves 100 114 patients (diabetic encounters), which are summarized according their 30-day readmission status (i.e. 0=NO, 1=YES). Totally 11% patients were readmitted within 30 days. Most of the patients were Caucasians. Slightly more patients were females (54% in both groups) and most of the patients were elderly and patients with circulatory primary diagnoses. Patients readmitted within 30 days, had significantly longer hospitalization, more laboratory procedures, medications, outpatient, inpatient, emergency visits and more diagnoses on average. Moreover, antidiabetic medicines were prescribed more frequently in these patients. Those having been readmitted were more often prescribed insulin, meglitinides and less often metformin, sulphonylureas and thiazolidinediones. In readmitted patients, change in medication was performed more frequently.

DM%>%
   tbl_summary(
    by = readmitted,
    statistic = list(
      all_continuous() ~ "{mean} ({sd})",
      all_categorical() ~ "{n} / {N} ({p}%)"
    ),
    digits = all_continuous() ~ 3,
  ) %>% 
  add_p()
Characteristic 0, N = 88,7571 1, N = 11,3571 p-value2
race

0.2
    AfricanAmerican 17,108 / 88,757 (19%) 2,194 / 11,357 (19%)
    Asian 573 / 88,757 (0.6%) 66 / 11,357 (0.6%)
    Caucasian 67,827 / 88,757 (76%) 8,730 / 11,357 (77%)
    Hispanic 1,865 / 88,757 (2.1%) 219 / 11,357 (1.9%)
    Other 1,384 / 88,757 (1.6%) 148 / 11,357 (1.3%)
gender

0.4
    F 47,710 / 88,757 (54%) 6,152 / 11,357 (54%)
    M 41,047 / 88,757 (46%) 5,205 / 11,357 (46%)
age_cat

<0.001
    30-60 years 27,374 / 88,757 (31%) 3,119 / 11,357 (27%)
    up to 100 59,162 / 88,757 (67%) 7,959 / 11,357 (70%)
    up to 30 2,221 / 88,757 (2.5%) 279 / 11,357 (2.5%)
time_in_hospital 4.341 (2.964) 4.768 (3.028) <0.001
num_lab_procedures 42.779 (19.659) 44.226 (19.276) <0.001
num_medications 15.864 (8.084) 16.903 (8.097) <0.001
number_outpatient 0.361 (1.259) 0.437 (1.303) <0.001
number_emergency 0.178 (0.862) 0.357 (1.370) <0.001
number_inpatient 0.557 (1.121) 1.224 (1.955) <0.001
number_diagnoses 7.373 (1.955) 7.693 (1.773) <0.001
primary_diagnosis

<0.001
    Circulatory 27,119 / 88,757 (31%) 3,553 / 11,357 (31%)
    Diabetes 7,556 / 88,757 (8.5%) 1,137 / 11,357 (10%)
    Digestive 10,292 / 88,757 (12%) 1,284 / 11,357 (11%)
    Endocrine, not DM 2,163 / 88,757 (2.4%) 304 / 11,357 (2.7%)
    Genitourinary 1,441 / 88,757 (1.6%) 213 / 11,357 (1.9%)
    Injury 18,185 / 88,757 (20%) 2,386 / 11,357 (21%)
    Musculosceletal 4,513 / 88,757 (5.1%) 477 / 11,357 (4.2%)
    Neoplasm 886 / 88,757 (1.0%) 84 / 11,357 (0.7%)
    Other 2,710 / 88,757 (3.1%) 366 / 11,357 (3.2%)
    Respiratory 13,508 / 88,757 (15%) 1,490 / 11,357 (13%)
    Skin 300 / 88,757 (0.3%) 54 / 11,357 (0.5%)
    Symptoms and ill_defined 84 / 88,757 (<0.1%) 9 / 11,357 (<0.1%)
insulin

<0.001
    NO 41,924 / 88,757 (47%) 4,756 / 11,357 (42%)
    Yes 46,833 / 88,757 (53%) 6,601 / 11,357 (58%)
Diabetesmed 68,161 / 88,757 (77%) 9,111 / 11,357 (80%) <0.001
gluc_test

<0.001
    High 12,868 / 88,757 (14%) 1,540 / 11,357 (14%)
    No 69,253 / 88,757 (78%) 9,056 / 11,357 (80%)
    Norm 6,636 / 88,757 (7.5%) 761 / 11,357 (6.7%)
metformin 17,959 / 88,757 (20%) 1,939 / 11,357 (17%) <0.001
glinids 1,931 / 88,757 (2.2%) 282 / 11,357 (2.5%) 0.036
sulphonylureas 25,002 / 88,757 (28%) 3,085 / 11,357 (27%) 0.025
glitazones 12,132 / 88,757 (14%) 1,435 / 11,357 (13%) 0.002
acarbose 312 / 88,757 (0.4%) 32 / 11,357 (0.3%) 0.2
change 40,885 / 88,757 (46%) 5,558 / 11,357 (49%) <0.001
combination 633 / 88,757 (0.7%) 79 / 11,357 (0.7%) 0.8
1 n / N (%); Mean (SD)
2 Pearson’s Chi-squared test; Wilcoxon rank sum test

Checking assumptions

Randomly sampled: met

Dichotomous outcome : met

Collinearity between continuous predictors

As can be seen, there is no significant collinearity between numeric predictors (independent variables).

DM_num<-dplyr::select_if(DM, is.numeric)
corrplot(cor(DM_num), method = "number")

Linearity of continuous predictors with logit - Box-Tidwell test

As Box-Tidwell test works with log values, variable transformation for variables containing 0 is needed.

DM_BT<-DM
DM_BT$outpatient_trans<-DM_BT$number_outpatient+1
DM_BT$inpatient_trans<-DM_BT$number_inpatient+1
DM_BT$emergency_trans<-DM_BT$number_emergency+1

Box-Tidwell test

boxtidwell<-glm(readmitted~time_in_hospital + time_in_hospital:log(time_in_hospital)+
                  num_lab_procedures+num_lab_procedures:log(num_lab_procedures)+num_medications+
                  num_medications:log(num_medications)+
                  outpatient_trans+outpatient_trans:log(outpatient_trans)+
                  emergency_trans+emergency_trans:log(emergency_trans)+
                  inpatient_trans+inpatient_trans:log(inpatient_trans)+number_diagnoses+
                  number_diagnoses:log(number_diagnoses)+race+gender+age_cat+primary_diagnosis+
                  insulin+Diabetesmed+gluc_test+metformin+glinids+sulphonylureas+glitazones+
                  acarbose+change+combination,
                data=DM_BT, family="binomial")
summary(boxtidwell)
## 
## Call:
## glm(formula = readmitted ~ time_in_hospital + time_in_hospital:log(time_in_hospital) + 
##     num_lab_procedures + num_lab_procedures:log(num_lab_procedures) + 
##     num_medications + num_medications:log(num_medications) + 
##     outpatient_trans + outpatient_trans:log(outpatient_trans) + 
##     emergency_trans + emergency_trans:log(emergency_trans) + 
##     inpatient_trans + inpatient_trans:log(inpatient_trans) + 
##     number_diagnoses + number_diagnoses:log(number_diagnoses) + 
##     race + gender + age_cat + primary_diagnosis + insulin + Diabetesmed + 
##     gluc_test + metformin + glinids + sulphonylureas + glitazones + 
##     acarbose + change + combination, family = "binomial", data = DM_BT)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6000  -0.4993  -0.4373  -0.3826   2.7945  
## 
## Coefficients:
##                                             Estimate Std. Error z value
## (Intercept)                                -5.035996   0.241942 -20.815
## time_in_hospital                            0.194310   0.028202   6.890
## num_lab_procedures                          0.010378   0.006195   1.675
## num_medications                             0.028488   0.014867   1.916
## outpatient_trans                            0.049232   0.034094   1.444
## emergency_trans                             0.195298   0.034135   5.721
## inpatient_trans                             0.576729   0.032817  17.574
## number_diagnoses                            0.366512   0.100180   3.659
## raceAsian                                   0.015512   0.134292   0.116
## raceCaucasian                               0.011006   0.026599   0.414
## raceHispanic                                0.003224   0.076429   0.042
## raceOther                                  -0.088370   0.090967  -0.971
## genderM                                     0.012036   0.020556   0.586
## age_catup to 100                            0.179540   0.024001   7.481
## age_catup to 30                             0.013264   0.073789   0.180
## primary_diagnosisDiabetes                   0.080718   0.039798   2.028
## primary_diagnosisDigestive                 -0.113356   0.035801  -3.166
## primary_diagnosisEndocrine, not DM          0.060679   0.065326   0.929
## primary_diagnosisGenitourinary              0.198269   0.077182   2.569
## primary_diagnosisInjury                    -0.039838   0.029048  -1.371
## primary_diagnosisMusculosceletal           -0.081220   0.053080  -1.530
## primary_diagnosisNeoplasm                  -0.184503   0.117437  -1.571
## primary_diagnosisOther                     -0.094645   0.059951  -1.579
## primary_diagnosisRespiratory               -0.208261   0.033355  -6.244
## primary_diagnosisSkin                       0.210352   0.152038   1.384
## primary_diagnosisSymptoms and ill_defined  -0.005930   0.353937  -0.017
## insulinYes                                 -0.023321   0.034342  -0.679
## DiabetesmedYes                              0.200140   0.038515   5.196
## gluc_testNo                                 0.062737   0.030633   2.048
## gluc_testNorm                              -0.013644   0.047928  -0.285
## metforminYes                               -0.153104   0.030505  -5.019
## glinidsYes                                 -0.023539   0.067257  -0.350
## sulphonylureasYes                          -0.069252   0.028622  -2.420
## glitazonesYes                              -0.101286   0.033001  -3.069
## acarboseYes                                -0.319602   0.189251  -1.689
## changeYes                                   0.051113   0.029605   1.726
## combinationYES                             -0.014668   0.122048  -0.120
## time_in_hospital:log(time_in_hospital)     -0.063035   0.010206  -6.176
## num_lab_procedures:log(num_lab_procedures) -0.002203   0.001353  -1.628
## num_medications:log(num_medications)       -0.006153   0.003680  -1.672
## outpatient_trans:log(outpatient_trans)     -0.024189   0.013615  -1.777
## emergency_trans:log(emergency_trans)       -0.052712   0.012317  -4.279
## inpatient_trans:log(inpatient_trans)       -0.139721   0.014039  -9.953
## number_diagnoses:log(number_diagnoses)     -0.115156   0.034780  -3.311
##                                            Pr(>|z|)    
## (Intercept)                                 < 2e-16 ***
## time_in_hospital                           5.58e-12 ***
## num_lab_procedures                         0.093884 .  
## num_medications                            0.055334 .  
## outpatient_trans                           0.148743    
## emergency_trans                            1.06e-08 ***
## inpatient_trans                             < 2e-16 ***
## number_diagnoses                           0.000254 ***
## raceAsian                                  0.908040    
## raceCaucasian                              0.679027    
## raceHispanic                               0.966356    
## raceOther                                  0.331322    
## genderM                                    0.558208    
## age_catup to 100                           7.40e-14 ***
## age_catup to 30                            0.857344    
## primary_diagnosisDiabetes                  0.042543 *  
## primary_diagnosisDigestive                 0.001544 ** 
## primary_diagnosisEndocrine, not DM         0.352961    
## primary_diagnosisGenitourinary             0.010204 *  
## primary_diagnosisInjury                    0.170228    
## primary_diagnosisMusculosceletal           0.125986    
## primary_diagnosisNeoplasm                  0.116163    
## primary_diagnosisOther                     0.114407    
## primary_diagnosisRespiratory               4.27e-10 ***
## primary_diagnosisSkin                      0.166496    
## primary_diagnosisSymptoms and ill_defined  0.986632    
## insulinYes                                 0.497089    
## DiabetesmedYes                             2.03e-07 ***
## gluc_testNo                                0.040555 *  
## gluc_testNorm                              0.775895    
## metforminYes                               5.20e-07 ***
## glinidsYes                                 0.726351    
## sulphonylureasYes                          0.015540 *  
## glitazonesYes                              0.002147 ** 
## acarboseYes                                0.091262 .  
## changeYes                                  0.084259 .  
## combinationYES                             0.904339    
## time_in_hospital:log(time_in_hospital)     6.57e-10 ***
## num_lab_procedures:log(num_lab_procedures) 0.103468    
## num_medications:log(num_medications)       0.094503 .  
## outpatient_trans:log(outpatient_trans)     0.075624 .  
## emergency_trans:log(emergency_trans)       1.87e-05 ***
## inpatient_trans:log(inpatient_trans)        < 2e-16 ***
## number_diagnoses:log(number_diagnoses)     0.000930 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 68018  on 100070  degrees of freedom
## AIC: 68106
## 
## Number of Fisher Scoring iterations: 5

Non-linearity was identified for length of hospitalization, number of inpatient and emergency visits and number of diagnoses. Based on highly left skewed distribution for number of inpatient and emergency visits, these variables were categorized (variable transformation recommended for highly left skewed data did not solve non linearity problem - check was performed outside this document). For length of hospitalization and number of diagnoses, natural cubic splines were used.

DM$number_emergency<-factor(ifelse((DM$number_emergency>=1) & (DM$number_emergency<=5),
                            "1-5 emergency visits",ifelse((DM$number_emergency>=6),
                            "6 and more emergency visits",
                            "no emergency visit")))
DM$number_inpatient<-factor(ifelse((DM$number_inpatient>=1) & (DM$number_inpatient<=5),
                            "1-5 inpatient visits",ifelse((DM$number_inpatient>=6),
                                                          "6 and more inpatient visits",
                                                         "no inpatient visit")))

Statistical analysis

Simple logistic regression

mod_1<-glm(readmitted~race, data=DM, family="binomial")
summary(mod_1)
## 
## Call:
## glm(formula = readmitted ~ race, family = "binomial", data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4921  -0.4921  -0.4921  -0.4913   2.1620  
## 
## Coefficients:
##                Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   -2.053820   0.022676 -90.571   <2e-16 ***
## raceAsian     -0.107411   0.131943  -0.814   0.4156    
## raceCaucasian  0.003625   0.025367   0.143   0.8864    
## raceHispanic  -0.088125   0.074941  -1.176   0.2396    
## raceOther     -0.181701   0.089397  -2.033   0.0421 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70803  on 100109  degrees of freedom
## AIC: 70813
## 
## Number of Fisher Scoring iterations: 4
mod_2<-glm(readmitted~gender, data=DM, family="binomial")
summary(mod_2)
## 
## Call:
## glm(formula = readmitted ~ gender, family = "binomial", data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4925  -0.4925  -0.4886  -0.4886   2.0902  
## 
## Coefficients:
##             Estimate Std. Error  z value Pr(>|z|)    
## (Intercept) -2.04836    0.01355 -151.212   <2e-16 ***
## genderM     -0.01673    0.02000   -0.837    0.403    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70810  on 100112  degrees of freedom
## AIC: 70814
## 
## Number of Fisher Scoring iterations: 4
mod_3<-glm(readmitted~age_cat, data=DM, family="binomial")
summary(mod_3)
## 
## Call:
## glm(formula = readmitted ~ age_cat, family = "binomial", data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.5024  -0.5024  -0.5024  -0.4646   2.1354  
## 
## Coefficients:
##                  Estimate Std. Error  z value Pr(>|z|)    
## (Intercept)      -2.17208    0.01890 -114.943  < 2e-16 ***
## age_catup to 100  0.16611    0.02235    7.431 1.08e-13 ***
## age_catup to 30   0.09758    0.06627    1.473    0.141    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70754  on 100111  degrees of freedom
## AIC: 70760
## 
## Number of Fisher Scoring iterations: 4
mod_4<-glm(readmitted~ns(time_in_hospital, df=5), data=DM, family="binomial")
summary(mod_4)
## 
## Call:
## glm(formula = readmitted ~ ns(time_in_hospital, df = 5), family = "binomial", 
##     data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.5447  -0.5136  -0.4810  -0.4603   2.2268  
## 
## Coefficients:
##                               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                   -2.39184    0.03063 -78.090  < 2e-16 ***
## ns(time_in_hospital, df = 5)1  0.29116    0.04601   6.328 2.48e-10 ***
## ns(time_in_hospital, df = 5)2  0.41703    0.04915   8.486  < 2e-16 ***
## ns(time_in_hospital, df = 5)3  0.55725    0.06027   9.246  < 2e-16 ***
## ns(time_in_hospital, df = 5)4  0.71929    0.07848   9.166  < 2e-16 ***
## ns(time_in_hospital, df = 5)5  0.33033    0.06503   5.080 3.78e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70525  on 100108  degrees of freedom
## AIC: 70537
## 
## Number of Fisher Scoring iterations: 5
mod_5<-glm(readmitted~num_lab_procedures, data=DM, family="binomial")
summary(mod_5)
## 
## Call:
## glm(formula = readmitted ~ num_lab_procedures, family = "binomial", 
##     data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.5707  -0.5009  -0.4885  -0.4722   2.1543  
## 
## Coefficients:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)        -2.220818   0.024663 -90.048  < 2e-16 ***
## num_lab_procedures  0.003787   0.000512   7.397 1.39e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70755  on 100112  degrees of freedom
## AIC: 70759
## 
## Number of Fisher Scoring iterations: 4
mod_6<-glm(readmitted~num_medications, data=DM, family="binomial")
summary(mod_6)
## 
## Call:
## glm(formula = readmitted ~ num_medications, family = "binomial", 
##     data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.7510  -0.4999  -0.4792  -0.4626   2.1828  
## 
## Coefficients:
##                 Estimate Std. Error z value Pr(>|z|)    
## (Intercept)     -2.30033    0.02185 -105.26   <2e-16 ***
## num_medications  0.01492    0.00116   12.86   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70651  on 100112  degrees of freedom
## AIC: 70655
## 
## Number of Fisher Scoring iterations: 4
mod_7<-glm(readmitted~number_outpatient, data=DM, family="binomial")
summary(mod_7)
## 
## Call:
## glm(formula = readmitted ~ number_outpatient, family = "binomial", 
##     data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0169  -0.4871  -0.4871  -0.4871   2.0931  
## 
## Coefficients:
##                    Estimate Std. Error  z value Pr(>|z|)    
## (Intercept)       -2.071913   0.010362 -199.944  < 2e-16 ***
## number_outpatient  0.040048   0.006703    5.975 2.31e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70778  on 100112  degrees of freedom
## AIC: 70782
## 
## Number of Fisher Scoring iterations: 4
mod_8<-glm(readmitted~number_emergency, data=DM, family="binomial")
summary(mod_8)
## 
## Call:
## glm(formula = readmitted ~ number_emergency, family = "binomial", 
##     data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.8190  -0.4745  -0.4745  -0.4745   2.1166  
## 
## Coefficients:
##                                             Estimate Std. Error z value
## (Intercept)                                 -1.62203    0.02591 -62.606
## number_emergency6 and more emergency visits  0.70197    0.11775   5.962
## number_emergencyno emergency visit          -0.50539    0.02810 -17.987
##                                             Pr(>|z|)    
## (Intercept)                                  < 2e-16 ***
## number_emergency6 and more emergency visits  2.5e-09 ***
## number_emergencyno emergency visit           < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70431  on 100111  degrees of freedom
## AIC: 70437
## 
## Number of Fisher Scoring iterations: 4
mod_9<-glm(readmitted~number_inpatient, data=DM, family="binomial")
summary(mod_9)
## 
## Call:
## glm(formula = readmitted ~ number_inpatient, family = "binomial", 
##     data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.0160  -0.5912  -0.4230  -0.4230   2.2173  
## 
## Coefficients:
##                                             Estimate Std. Error z value
## (Intercept)                                 -1.65561    0.01517 -109.10
## number_inpatient6 and more inpatient visits  1.26345    0.06106   20.69
## number_inpatientno inpatient visit          -0.71319    0.02054  -34.72
##                                             Pr(>|z|)    
## (Intercept)                                   <2e-16 ***
## number_inpatient6 and more inpatient visits   <2e-16 ***
## number_inpatientno inpatient visit            <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 68965  on 100111  degrees of freedom
## AIC: 68971
## 
## Number of Fisher Scoring iterations: 5
mod_10<-glm(readmitted~ns(number_diagnoses, df=5), data=DM, family="binomial")
summary(mod_10)
## 
## Call:
## glm(formula = readmitted ~ ns(number_diagnoses, df = 5), family = "binomial", 
##     data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.5487  -0.5209  -0.5022  -0.4423   2.4107  
## 
## Coefficients:
##                               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                    -2.8495     0.1345 -21.185  < 2e-16 ***
## ns(number_diagnoses, df = 5)1   0.7884     0.1222   6.452 1.11e-10 ***
## ns(number_diagnoses, df = 5)2   0.8590     0.1599   5.373 7.73e-08 ***
## ns(number_diagnoses, df = 5)3   0.9072     0.2284   3.973 7.11e-05 ***
## ns(number_diagnoses, df = 5)4   1.4580     0.3536   4.124 3.73e-05 ***
## ns(number_diagnoses, df = 5)5   0.6393     0.4215   1.517    0.129    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70516  on 100108  degrees of freedom
## AIC: 70528
## 
## Number of Fisher Scoring iterations: 5
mod_11<-glm(readmitted~primary_diagnosis, data=DM, family="binomial")
summary(mod_11)
## 
## Call:
## glm(formula = readmitted ~ primary_diagnosis, family = "binomial", 
##     data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.5754  -0.4966  -0.4962  -0.4575   2.2120  
## 
## Coefficients:
##                                            Estimate Std. Error  z value
## (Intercept)                               -2.032442   0.017841 -113.917
## primary_diagnosisDiabetes                  0.138494   0.036471    3.797
## primary_diagnosisDigestive                -0.048944   0.034558   -1.416
## primary_diagnosisEndocrine, not DM         0.070219   0.063797    1.101
## primary_diagnosisGenitourinary             0.120642   0.075545    1.597
## primary_diagnosisInjury                    0.001464   0.028150    0.052
## primary_diagnosisMusculosceletal          -0.214759   0.051339   -4.183
## primary_diagnosisNeoplasm                 -0.323458   0.115515   -2.800
## primary_diagnosisOther                     0.030372   0.058477    0.519
## primary_diagnosisRespiratory              -0.172064   0.032609   -5.277
## primary_diagnosisSkin                      0.317644   0.148897    2.133
## primary_diagnosisSymptoms and ill_defined -0.201150   0.351149   -0.573
##                                           Pr(>|z|)    
## (Intercept)                                < 2e-16 ***
## primary_diagnosisDiabetes                 0.000146 ***
## primary_diagnosisDigestive                0.156688    
## primary_diagnosisEndocrine, not DM        0.271047    
## primary_diagnosisGenitourinary            0.110278    
## primary_diagnosisInjury                   0.958536    
## primary_diagnosisMusculosceletal          2.88e-05 ***
## primary_diagnosisNeoplasm                 0.005108 ** 
## primary_diagnosisOther                    0.603494    
## primary_diagnosisRespiratory              1.32e-07 ***
## primary_diagnosisSkin                     0.032899 *  
## primary_diagnosisSymptoms and ill_defined 0.566758    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70715  on 100102  degrees of freedom
## AIC: 70739
## 
## Number of Fisher Scoring iterations: 4
mod_12<-glm(readmitted~insulin, data=DM, family="binomial")
summary(mod_12)
## 
## Call:
## glm(formula = readmitted ~ insulin, family = "binomial", data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.5135  -0.5135  -0.4636  -0.4636   2.1372  
## 
## Coefficients:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept) -2.17645    0.01530 -142.25   <2e-16 ***
## insulinYes   0.21708    0.02017   10.76   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70694  on 100112  degrees of freedom
## AIC: 70698
## 
## Number of Fisher Scoring iterations: 4
mod_13<-glm(readmitted~Diabetesmed, data=DM, family="binomial")
summary(mod_13)
## 
## Call:
## glm(formula = readmitted ~ Diabetesmed, family = "binomial", 
##     data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.5009  -0.5009  -0.5009  -0.4550   2.1538  
## 
## Coefficients:
##                Estimate Std. Error z value Pr(>|z|)    
## (Intercept)    -2.21595    0.02222 -99.731  < 2e-16 ***
## DiabetesmedYes  0.20356    0.02486   8.187 2.67e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70741  on 100112  degrees of freedom
## AIC: 70745
## 
## Number of Fisher Scoring iterations: 4
mod_14<-glm(readmitted~gluc_test, data=DM, family="binomial")
summary(mod_14)
## 
## Call:
## glm(formula = readmitted ~ gluc_test, family = "binomial", data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4958  -0.4958  -0.4958  -0.4755   2.1327  
## 
## Coefficients:
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   -2.12296    0.02696 -78.736  < 2e-16 ***
## gluc_testNo    0.08862    0.02919   3.036  0.00239 ** 
## gluc_testNorm -0.04267    0.04681  -0.911  0.36205    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70792  on 100111  degrees of freedom
## AIC: 70798
## 
## Number of Fisher Scoring iterations: 4
mod_15<-glm(readmitted~metformin, data=DM, family="binomial")
summary(mod_15)
## 
## Call:
## glm(formula = readmitted ~ metformin, family = "binomial", data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4998  -0.4998  -0.4998  -0.4528   2.1580  
## 
## Coefficients:
##              Estimate Std. Error  z value Pr(>|z|)    
## (Intercept)  -2.01721    0.01097 -183.914  < 2e-16 ***
## metforminYes -0.20871    0.02630   -7.936 2.08e-15 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70745  on 100112  degrees of freedom
## AIC: 70749
## 
## Number of Fisher Scoring iterations: 4
mod_16<-glm(readmitted~glinids, data=DM, family="binomial")
summary(mod_16)
## 
## Call:
## glm(formula = readmitted ~ glinids, family = "binomial", data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.5221  -0.4900  -0.4900  -0.4900   2.0877  
## 
## Coefficients:
##             Estimate Std. Error  z value Pr(>|z|)    
## (Intercept) -2.05922    0.01009 -204.086   <2e-16 ***
## glinidsYes   0.13533    0.06454    2.097    0.036 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70806  on 100112  degrees of freedom
## AIC: 70810
## 
## Number of Fisher Scoring iterations: 4
mod_17<-glm(readmitted~sulphonylureas, data=DM, family="binomial")
summary(mod_17)
## 
## Call:
## glm(formula = readmitted ~ sulphonylureas, family = "binomial", 
##     data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4940  -0.4940  -0.4940  -0.4824   2.1018  
## 
## Coefficients:
##                   Estimate Std. Error  z value Pr(>|z|)    
## (Intercept)       -2.04217    0.01169 -174.749   <2e-16 ***
## sulphonylureasYes -0.05023    0.02238   -2.245   0.0248 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70805  on 100112  degrees of freedom
## AIC: 70809
## 
## Number of Fisher Scoring iterations: 4
mod_18<-glm(readmitted~glitazones, data=DM, family="binomial")
summary(mod_18)
## 
## Call:
## glm(formula = readmitted ~ glitazones, family = "binomial", data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4935  -0.4935  -0.4935  -0.4935   2.1197  
## 
## Coefficients:
##               Estimate Std. Error  z value Pr(>|z|)    
## (Intercept)   -2.04417    0.01067 -191.594  < 2e-16 ***
## glitazonesYes -0.09051    0.02988   -3.029  0.00246 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70801  on 100112  degrees of freedom
## AIC: 70805
## 
## Number of Fisher Scoring iterations: 4
mod_19<-glm(readmitted~combination, data=DM, family="binomial")
summary(mod_19)
## 
## Call:
## glm(formula = readmitted ~ combination, family = "binomial", 
##     data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4908  -0.4908  -0.4908  -0.4908   2.0970  
## 
## Coefficients:
##                Estimate Std. Error z value Pr(>|z|)    
## (Intercept)    -2.05589    0.01000 -205.58   <2e-16 ***
## combinationYES -0.02513    0.11974   -0.21    0.834    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70810  on 100112  degrees of freedom
## AIC: 70814
## 
## Number of Fisher Scoring iterations: 4
mod_20<-glm(readmitted~acarbose, data=DM, family="binomial")
summary(mod_20)
## 
## Call:
## glm(formula = readmitted ~ acarbose, family = "binomial", data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.4909  -0.4909  -0.4909  -0.4909   2.1794  
## 
## Coefficients:
##             Estimate Std. Error  z value Pr(>|z|)    
## (Intercept) -2.05537    0.00998 -205.946   <2e-16 ***
## acarboseYes -0.22190    0.18586   -1.194    0.233    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70809  on 100112  degrees of freedom
## AIC: 70813
## 
## Number of Fisher Scoring iterations: 4
mod_21<-glm(readmitted~change, data=DM, family="binomial")
summary(mod_21)
## 
## Call:
## glm(formula = readmitted ~ change, family = "binomial", data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -0.5049  -0.5049  -0.4782  -0.4782   2.1096  
## 
## Coefficients:
##             Estimate Std. Error  z value Pr(>|z|)    
## (Intercept) -2.11085    0.01390 -151.816  < 2e-16 ***
## changeYes    0.11532    0.01994    5.783 7.35e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 70777  on 100112  degrees of freedom
## AIC: 70781
## 
## Number of Fisher Scoring iterations: 4

Simple logistic regression identified following significant risk factors: race, age, time in hospital, number of laboratory procedures, number of medications, number of outpatient, inpatient and emergency visits, number of diagnoses, primary diagnosis, prescription of antidiabetic medicines as a general and any change in antidiabetic medicines prescription, glycaemia test, prescription of insulin, metformin, meglitinides, sulphonylureas and thiazolidinediones.

Multiple logistic regression

To get the same reference groups as Beata Strack et al.

DM$gluc_test<-relevel(DM$gluc_test, ref="No")
DM$number_inpatient<-relevel(DM$number_inpatient, ref="no inpatient visit")
DM$number_emergency<-relevel(DM$number_emergency, ref="no emergency visit")
DM$primary_diagnosis<-relevel(DM$primary_diagnosis, ref="Diabetes")

After removing insignificant predictors, the final model identified following significant predictors increasing probability of 30-day readmission: compared to the category 30-60 years old patients, elderly patients (60 and older) had increased probability of being readmitted by 17% (OR=1.17, 95%CI: 1.12-1.23). Further, length of hospitalization and number of diagnoses were also significantly associated with increased probability of being readmitted (beta coefficients from regression splines cannot be easily interpreted, however visualization for length of hospitalization can be seen below). Number of inpatient visits in the previous year compared to no such visit increased probability of being readmitted by 85% for 1-5 inpatient visits and by 497% in 6 and more inpatient visits. Similarly, significantly increased probability can be seen in the for number of emergency visits. Being prescribed antidiabetic medicines generally increased risk by 23%. Compared to primary diagnosis of diabetes, patients diagnosed with circulatory, digestive, injury, musculoskeletal and respiratory primary diagnosis or those with neoplasms and diagnoses under the other category had significantly lower probability of being readmitted. Patients in whom glycaemia test (irrespective of whether high or normal values were found) was performed, those prescribed metformin, sulphonylureas and thiazolidinediones had significantly lower probability of being readmitted.

model<-glm(readmitted~race+age_cat+ns(time_in_hospital, df=5)+
             num_lab_procedures+num_medications+number_outpatient+
             number_inpatient+ns(number_diagnoses,df=5)+
             number_emergency+primary_diagnosis+insulin+Diabetesmed+
             gluc_test+metformin+glinids+sulphonylureas+
             glitazones+change,data=DM, family="binomial")
model %>% 
  tbl_regression(exponentiate = TRUE) %>% 
  bold_labels() %>% 
  bold_p(t=.1)
Characteristic OR1 95% CI1 p-value
race


    AfricanAmerican
    Asian 1.00 0.76, 1.29 >0.9
    Caucasian 1.01 0.96, 1.06 0.7
    Hispanic 1.00 0.86, 1.16 >0.9
    Other 0.91 0.76, 1.09 0.3
age_cat


    30-60 years
    up to 100 1.17 1.12, 1.23 <0.001
    up to 30 1.03 0.90, 1.19 0.6
ns(time_in_hospital, df = 5)


    ns(time_in_hospital, df = 5)1 1.23 1.12, 1.34 <0.001
    ns(time_in_hospital, df = 5)2 1.30 1.18, 1.44 <0.001
    ns(time_in_hospital, df = 5)3 1.43 1.26, 1.62 <0.001
    ns(time_in_hospital, df = 5)4 1.48 1.26, 1.75 <0.001
    ns(time_in_hospital, df = 5)5 1.12 0.97, 1.28 0.11
num_lab_procedures 1.00 1.00, 1.00 0.5
num_medications 1.00 1.00, 1.01 0.003
number_outpatient 0.99 0.98, 1.01 0.4
number_inpatient


    no inpatient visit
    1-5 inpatient visits 1.85 1.78, 1.93 <0.001
    6 and more inpatient visits 5.97 5.26, 6.77 <0.001
ns(number_diagnoses, df = 5)


    ns(number_diagnoses, df = 5)1 1.73 1.36, 2.23 <0.001
    ns(number_diagnoses, df = 5)2 1.85 1.34, 2.56 <0.001
    ns(number_diagnoses, df = 5)3 1.21 0.77, 1.92 0.4
    ns(number_diagnoses, df = 5)4 2.21 1.08, 4.48 0.028
    ns(number_diagnoses, df = 5)5 1.36 0.54, 2.92 0.5
number_emergency


    no emergency visit
    1-5 emergency visits 1.28 1.21, 1.36 <0.001
    6 and more emergency visits 1.62 1.27, 2.07 <0.001
primary_diagnosis


    Diabetes
    Circulatory 0.90 0.84, 0.98 0.010
    Digestive 0.81 0.74, 0.88 <0.001
    Endocrine, not DM 0.95 0.83, 1.09 0.5
    Genitourinary 1.10 0.93, 1.29 0.2
    Injury 0.87 0.80, 0.94 <0.001
    Musculosceletal 0.83 0.74, 0.94 0.003
    Neoplasm 0.75 0.59, 0.95 0.020
    Other 0.83 0.72, 0.94 0.004
    Respiratory 0.74 0.68, 0.81 <0.001
    Skin 1.13 0.83, 1.51 0.4
    Symptoms and ill_defined 0.88 0.41, 1.66 0.7
insulin


    NO
    Yes 0.98 0.92, 1.05 0.6
Diabetesmed


    No
    Yes 1.23 1.14, 1.33 <0.001
gluc_test


    No
    High 0.93 0.88, 0.99 0.026
    Norm 0.92 0.85, 0.99 0.031
metformin


    No
    Yes 0.84 0.79, 0.89 <0.001
glinids


    No
    Yes 0.97 0.85, 1.10 0.6
sulphonylureas


    No
    Yes 0.92 0.87, 0.97 0.003
glitazones


    No
    Yes 0.89 0.84, 0.95 <0.001
change


    No
    Yes 1.05 1.00, 1.12 0.073
1 OR = Odds Ratio, CI = Confidence Interval

Free of outliers - Cooks distance

No significant outliers were identified.

plot(model, which = 4)

Effect of “time in hospital (i.e. length of hospitalization)” on the response variable can be visualized

Length of hospitalization of 8 days and longer had little effect on predicted response.

N <- 14
x <- DM[which.max(complete.cases(DM)), ]
df <- do.call(rbind, lapply(1:N, function(i) x))
df$time_in_hospital <- with(DM, seq(min(time_in_hospital, na.rm=TRUE), max(time_in_hospital, na.rm=TRUE), length.out=N))
df$readmitted.hat <- predict(model, newdata=df) 
dtime_in_hospital <- diff(df$time_in_hospital[1:2])
delta <- diff(df$readmitted.hat/dtime_in_hospital)
time_in_hospital1 <- (df$time_in_hospital[-N] + df$time_in_hospital[-1]) / 2
plot(time_in_hospital1, delta, type="l", lwd=2, ylab="Change per day", xlab="Time_in_hospital",
     main="Spline Slope (Effective Coefficient)")

Pairwise interaction

In the model including interaction terms, advanced age, length of hospitalization, number of medications, inpatient, emergency visits in the previous year, number of diagnoses, prescription of antidiabetic medicines and any change in antidiabetic medicines were associated with increased probability of being hospitalized. Compared to non-interaction model, age category 30 years and younger had significantly lower risk of being readmitted within 30 days following discharge. Prescription of specific treatments - metformin, sulphonylureas, meglitinides,thiazolidinediones and the fact, that blood glucose test was performed, were still associated with significantly lower readmission rate. Digestive and respiratory primary diagnoses were both associated with decreased probability of being readmitted. Patients up to 30 with any inpatient visit in the previous year had significantly increased probability of being readmitted, as can be seen, the probability of being readmitted increased with number of inpatients visits. On the contrary, in elderly, any inpatient visit in the last year was associated with significantly lower probability of being re-hospitalized. In terms of primary diagnosis, number of previous hospitalization did not uniformly increased/decreased probability of being re-hospitalized. Insulin prescription was associated with increased risk of re-hospitalization in those prescribed metiglinides.

model_int<-glm(readmitted~race+age_cat+ns(time_in_hospital, df=5)+
             num_lab_procedures+num_medications+number_outpatient+
             number_inpatient+number_inpatient*age_cat+number_inpatient*primary_diagnosis+
             ns(number_diagnoses,df=5)+
             number_emergency+primary_diagnosis+insulin+Diabetesmed+
             gluc_test+insulin*metformin+metformin+insulin*glinids+glinids+insulin*sulphonylureas+
             sulphonylureas+glitazones+insulin*glitazones+change,data=DM, family="binomial")
summary(model_int)
## 
## Call:
## glm(formula = readmitted ~ race + age_cat + ns(time_in_hospital, 
##     df = 5) + num_lab_procedures + num_medications + number_outpatient + 
##     number_inpatient + number_inpatient * age_cat + number_inpatient * 
##     primary_diagnosis + ns(number_diagnoses, df = 5) + number_emergency + 
##     primary_diagnosis + insulin + Diabetesmed + gluc_test + insulin * 
##     metformin + metformin + insulin * glinids + glinids + insulin * 
##     sulphonylureas + sulphonylureas + glitazones + insulin * 
##     glitazones + change, family = "binomial", data = DM)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7292  -0.5273  -0.4411  -0.3701   2.6531  
## 
## Coefficients: (1 not defined because of singularities)
##                                                                                         Estimate
## (Intercept)                                                                           -3.3112629
## raceAsian                                                                             -0.0010149
## raceCaucasian                                                                          0.0079485
## raceHispanic                                                                           0.0153192
## raceOther                                                                             -0.0942853
## age_catup to 100                                                                       0.3014895
## age_catup to 30                                                                       -0.3291271
## ns(time_in_hospital, df = 5)1                                                          0.2022506
## ns(time_in_hospital, df = 5)2                                                          0.2574979
## ns(time_in_hospital, df = 5)3                                                          0.3568768
## ns(time_in_hospital, df = 5)4                                                          0.3910893
## ns(time_in_hospital, df = 5)5                                                          0.1050083
## num_lab_procedures                                                                     0.0003900
## num_medications                                                                        0.0039913
## number_outpatient                                                                     -0.0049280
## number_inpatient1-5 inpatient visits                                                   0.9684984
## number_inpatient6 and more inpatient visits                                            2.0600743
## primary_diagnosisCirculatory                                                           0.0223326
## primary_diagnosisDigestive                                                            -0.1854262
## primary_diagnosisEndocrine, not DM                                                    -0.0124428
## primary_diagnosisGenitourinary                                                         0.0308013
## primary_diagnosisInjury                                                                0.0149998
## primary_diagnosisMusculosceletal                                                      -0.0572273
## primary_diagnosisNeoplasm                                                             -0.2827291
## primary_diagnosisOther                                                                -0.0886842
## primary_diagnosisRespiratory                                                          -0.3005369
## primary_diagnosisSkin                                                                  0.4097851
## primary_diagnosisSymptoms and ill_defined                                              0.3410707
## ns(number_diagnoses, df = 5)1                                                          0.4484724
## ns(number_diagnoses, df = 5)2                                                          0.4975053
## ns(number_diagnoses, df = 5)3                                                          0.1688997
## ns(number_diagnoses, df = 5)4                                                          0.5731671
## ns(number_diagnoses, df = 5)5                                                          0.2359420
## number_emergency1-5 emergency visits                                                   0.2352406
## number_emergency6 and more emergency visits                                            0.3760865
## insulinYes                                                                            -0.1196003
## DiabetesmedYes                                                                         0.2965711
## gluc_testHigh                                                                         -0.0628596
## gluc_testNorm                                                                         -0.0873590
## metforminYes                                                                          -0.2570292
## glinidsYes                                                                            -0.2634415
## sulphonylureasYes                                                                     -0.1312054
## glitazonesYes                                                                         -0.1926880
## changeYes                                                                              0.0664763
## age_catup to 100:number_inpatient1-5 inpatient visits                                 -0.2897346
## age_catup to 30:number_inpatient1-5 inpatient visits                                   0.5734373
## age_catup to 100:number_inpatient6 and more inpatient visits                          -0.5399536
## age_catup to 30:number_inpatient6 and more inpatient visits                            0.6692139
## number_inpatient1-5 inpatient visits:primary_diagnosisCirculatory                     -0.2364879
## number_inpatient6 and more inpatient visits:primary_diagnosisCirculatory              -0.1649077
## number_inpatient1-5 inpatient visits:primary_diagnosisDigestive                       -0.0465567
## number_inpatient6 and more inpatient visits:primary_diagnosisDigestive                 0.1607852
## number_inpatient1-5 inpatient visits:primary_diagnosisEndocrine, not DM                0.0235355
## number_inpatient6 and more inpatient visits:primary_diagnosisEndocrine, not DM        -1.1029112
## number_inpatient1-5 inpatient visits:primary_diagnosisGenitourinary                    0.1602101
## number_inpatient6 and more inpatient visits:primary_diagnosisGenitourinary             1.3827251
## number_inpatient1-5 inpatient visits:primary_diagnosisInjury                          -0.2808006
## number_inpatient6 and more inpatient visits:primary_diagnosisInjury                   -0.2756572
## number_inpatient1-5 inpatient visits:primary_diagnosisMusculosceletal                 -0.3075110
## number_inpatient6 and more inpatient visits:primary_diagnosisMusculosceletal           0.1868526
## number_inpatient1-5 inpatient visits:primary_diagnosisNeoplasm                         0.0867692
## number_inpatient6 and more inpatient visits:primary_diagnosisNeoplasm                  1.0362750
## number_inpatient1-5 inpatient visits:primary_diagnosisOther                           -0.1987387
## number_inpatient6 and more inpatient visits:primary_diagnosisOther                     0.2534664
## number_inpatient1-5 inpatient visits:primary_diagnosisRespiratory                      0.0306209
## number_inpatient6 and more inpatient visits:primary_diagnosisRespiratory               0.2795704
## number_inpatient1-5 inpatient visits:primary_diagnosisSkin                            -0.5220346
## number_inpatient6 and more inpatient visits:primary_diagnosisSkin                     -8.7143340
## number_inpatient1-5 inpatient visits:primary_diagnosisSymptoms and ill_defined        -1.8486360
## number_inpatient6 and more inpatient visits:primary_diagnosisSymptoms and ill_defined         NA
## insulinYes:metforminYes                                                                0.1193139
## insulinYes:glinidsYes                                                                  0.3490884
## insulinYes:sulphonylureasYes                                                           0.0244746
## insulinYes:glitazonesYes                                                               0.1033556
##                                                                                       Std. Error
## (Intercept)                                                                            0.1519705
## raceAsian                                                                              0.1341619
## raceCaucasian                                                                          0.0264632
## raceHispanic                                                                           0.0763335
## raceOther                                                                              0.0908360
## age_catup to 100                                                                       0.0328269
## age_catup to 30                                                                        0.1222270
## ns(time_in_hospital, df = 5)1                                                          0.0473394
## ns(time_in_hospital, df = 5)2                                                          0.0512871
## ns(time_in_hospital, df = 5)3                                                          0.0637832
## ns(time_in_hospital, df = 5)4                                                          0.0836406
## ns(time_in_hospital, df = 5)5                                                          0.0697985
## num_lab_procedures                                                                     0.0005693
## num_medications                                                                        0.0015181
## number_outpatient                                                                      0.0076121
## number_inpatient1-5 inpatient visits                                                   0.0753161
## number_inpatient6 and more inpatient visits                                            0.1622201
## primary_diagnosisCirculatory                                                           0.0576540
## primary_diagnosisDigestive                                                             0.0682795
## primary_diagnosisEndocrine, not DM                                                     0.1027892
## primary_diagnosisGenitourinary                                                         0.1168455
## primary_diagnosisInjury                                                                0.0599603
## primary_diagnosisMusculosceletal                                                       0.0791665
## primary_diagnosisNeoplasm                                                              0.1531358
## primary_diagnosisOther                                                                 0.0965552
## primary_diagnosisRespiratory                                                           0.0653704
## primary_diagnosisSkin                                                                  0.2139294
## primary_diagnosisSymptoms and ill_defined                                              0.3800840
## ns(number_diagnoses, df = 5)1                                                          0.1281360
## ns(number_diagnoses, df = 5)2                                                          0.1665897
## ns(number_diagnoses, df = 5)3                                                          0.2343501
## ns(number_diagnoses, df = 5)4                                                          0.3648682
## ns(number_diagnoses, df = 5)5                                                          0.4236734
## number_emergency1-5 emergency visits                                                   0.0301060
## number_emergency6 and more emergency visits                                            0.1282462
## insulinYes                                                                             0.0685429
## DiabetesmedYes                                                                         0.0637415
## gluc_testHigh                                                                          0.0305918
## gluc_testNorm                                                                          0.0404797
## metforminYes                                                                           0.0539948
## glinidsYes                                                                             0.1153759
## sulphonylureasYes                                                                      0.0570745
## glitazonesYes                                                                          0.0572277
## changeYes                                                                              0.0306903
## age_catup to 100:number_inpatient1-5 inpatient visits                                  0.0472855
## age_catup to 30:number_inpatient1-5 inpatient visits                                   0.1600131
## age_catup to 100:number_inpatient6 and more inpatient visits                           0.1399012
## age_catup to 30:number_inpatient6 and more inpatient visits                            0.2387156
## number_inpatient1-5 inpatient visits:primary_diagnosisCirculatory                      0.0802059
## number_inpatient6 and more inpatient visits:primary_diagnosisCirculatory               0.2167067
## number_inpatient1-5 inpatient visits:primary_diagnosisDigestive                        0.0935700
## number_inpatient6 and more inpatient visits:primary_diagnosisDigestive                 0.2189224
## number_inpatient1-5 inpatient visits:primary_diagnosisEndocrine, not DM                0.1439650
## number_inpatient6 and more inpatient visits:primary_diagnosisEndocrine, not DM         0.4879928
## number_inpatient1-5 inpatient visits:primary_diagnosisGenitourinary                    0.1700244
## number_inpatient6 and more inpatient visits:primary_diagnosisGenitourinary             0.5281252
## number_inpatient1-5 inpatient visits:primary_diagnosisInjury                           0.0834945
## number_inpatient6 and more inpatient visits:primary_diagnosisInjury                    0.2075153
## number_inpatient1-5 inpatient visits:primary_diagnosisMusculosceletal                  0.1300666
## number_inpatient6 and more inpatient visits:primary_diagnosisMusculosceletal           0.4919363
## number_inpatient1-5 inpatient visits:primary_diagnosisNeoplasm                         0.2615723
## number_inpatient6 and more inpatient visits:primary_diagnosisNeoplasm                  0.8078451
## number_inpatient1-5 inpatient visits:primary_diagnosisOther                            0.1351344
## number_inpatient6 and more inpatient visits:primary_diagnosisOther                     0.3430255
## number_inpatient1-5 inpatient visits:primary_diagnosisRespiratory                      0.0903196
## number_inpatient6 and more inpatient visits:primary_diagnosisRespiratory               0.2268022
## number_inpatient1-5 inpatient visits:primary_diagnosisSkin                             0.3058074
## number_inpatient6 and more inpatient visits:primary_diagnosisSkin                     43.9548524
## number_inpatient1-5 inpatient visits:primary_diagnosisSymptoms and ill_defined         1.0940067
## number_inpatient6 and more inpatient visits:primary_diagnosisSymptoms and ill_defined         NA
## insulinYes:metforminYes                                                                0.0634768
## insulinYes:glinidsYes                                                                  0.1411935
## insulinYes:sulphonylureasYes                                                           0.0631361
## insulinYes:glitazonesYes                                                               0.0684200
##                                                                                       z value
## (Intercept)                                                                           -21.789
## raceAsian                                                                              -0.008
## raceCaucasian                                                                           0.300
## raceHispanic                                                                            0.201
## raceOther                                                                              -1.038
## age_catup to 100                                                                        9.184
## age_catup to 30                                                                        -2.693
## ns(time_in_hospital, df = 5)1                                                           4.272
## ns(time_in_hospital, df = 5)2                                                           5.021
## ns(time_in_hospital, df = 5)3                                                           5.595
## ns(time_in_hospital, df = 5)4                                                           4.676
## ns(time_in_hospital, df = 5)5                                                           1.504
## num_lab_procedures                                                                      0.685
## num_medications                                                                         2.629
## number_outpatient                                                                      -0.647
## number_inpatient1-5 inpatient visits                                                   12.859
## number_inpatient6 and more inpatient visits                                            12.699
## primary_diagnosisCirculatory                                                            0.387
## primary_diagnosisDigestive                                                             -2.716
## primary_diagnosisEndocrine, not DM                                                     -0.121
## primary_diagnosisGenitourinary                                                          0.264
## primary_diagnosisInjury                                                                 0.250
## primary_diagnosisMusculosceletal                                                       -0.723
## primary_diagnosisNeoplasm                                                              -1.846
## primary_diagnosisOther                                                                 -0.918
## primary_diagnosisRespiratory                                                           -4.597
## primary_diagnosisSkin                                                                   1.916
## primary_diagnosisSymptoms and ill_defined                                               0.897
## ns(number_diagnoses, df = 5)1                                                           3.500
## ns(number_diagnoses, df = 5)2                                                           2.986
## ns(number_diagnoses, df = 5)3                                                           0.721
## ns(number_diagnoses, df = 5)4                                                           1.571
## ns(number_diagnoses, df = 5)5                                                           0.557
## number_emergency1-5 emergency visits                                                    7.814
## number_emergency6 and more emergency visits                                             2.933
## insulinYes                                                                             -1.745
## DiabetesmedYes                                                                          4.653
## gluc_testHigh                                                                          -2.055
## gluc_testNorm                                                                          -2.158
## metforminYes                                                                           -4.760
## glinidsYes                                                                             -2.283
## sulphonylureasYes                                                                      -2.299
## glitazonesYes                                                                          -3.367
## changeYes                                                                               2.166
## age_catup to 100:number_inpatient1-5 inpatient visits                                  -6.127
## age_catup to 30:number_inpatient1-5 inpatient visits                                    3.584
## age_catup to 100:number_inpatient6 and more inpatient visits                           -3.860
## age_catup to 30:number_inpatient6 and more inpatient visits                             2.803
## number_inpatient1-5 inpatient visits:primary_diagnosisCirculatory                      -2.949
## number_inpatient6 and more inpatient visits:primary_diagnosisCirculatory               -0.761
## number_inpatient1-5 inpatient visits:primary_diagnosisDigestive                        -0.498
## number_inpatient6 and more inpatient visits:primary_diagnosisDigestive                  0.734
## number_inpatient1-5 inpatient visits:primary_diagnosisEndocrine, not DM                 0.163
## number_inpatient6 and more inpatient visits:primary_diagnosisEndocrine, not DM         -2.260
## number_inpatient1-5 inpatient visits:primary_diagnosisGenitourinary                     0.942
## number_inpatient6 and more inpatient visits:primary_diagnosisGenitourinary              2.618
## number_inpatient1-5 inpatient visits:primary_diagnosisInjury                           -3.363
## number_inpatient6 and more inpatient visits:primary_diagnosisInjury                    -1.328
## number_inpatient1-5 inpatient visits:primary_diagnosisMusculosceletal                  -2.364
## number_inpatient6 and more inpatient visits:primary_diagnosisMusculosceletal            0.380
## number_inpatient1-5 inpatient visits:primary_diagnosisNeoplasm                          0.332
## number_inpatient6 and more inpatient visits:primary_diagnosisNeoplasm                   1.283
## number_inpatient1-5 inpatient visits:primary_diagnosisOther                            -1.471
## number_inpatient6 and more inpatient visits:primary_diagnosisOther                      0.739
## number_inpatient1-5 inpatient visits:primary_diagnosisRespiratory                       0.339
## number_inpatient6 and more inpatient visits:primary_diagnosisRespiratory                1.233
## number_inpatient1-5 inpatient visits:primary_diagnosisSkin                             -1.707
## number_inpatient6 and more inpatient visits:primary_diagnosisSkin                      -0.198
## number_inpatient1-5 inpatient visits:primary_diagnosisSymptoms and ill_defined         -1.690
## number_inpatient6 and more inpatient visits:primary_diagnosisSymptoms and ill_defined      NA
## insulinYes:metforminYes                                                                 1.880
## insulinYes:glinidsYes                                                                   2.472
## insulinYes:sulphonylureasYes                                                            0.388
## insulinYes:glitazonesYes                                                                1.511
##                                                                                       Pr(>|z|)
## (Intercept)                                                                            < 2e-16
## raceAsian                                                                             0.993965
## raceCaucasian                                                                         0.763903
## raceHispanic                                                                          0.840943
## raceOther                                                                             0.299282
## age_catup to 100                                                                       < 2e-16
## age_catup to 30                                                                       0.007086
## ns(time_in_hospital, df = 5)1                                                         1.93e-05
## ns(time_in_hospital, df = 5)2                                                         5.15e-07
## ns(time_in_hospital, df = 5)3                                                         2.20e-08
## ns(time_in_hospital, df = 5)4                                                         2.93e-06
## ns(time_in_hospital, df = 5)5                                                         0.132466
## num_lab_procedures                                                                    0.493255
## num_medications                                                                       0.008558
## number_outpatient                                                                     0.517380
## number_inpatient1-5 inpatient visits                                                   < 2e-16
## number_inpatient6 and more inpatient visits                                            < 2e-16
## primary_diagnosisCirculatory                                                          0.698494
## primary_diagnosisDigestive                                                            0.006614
## primary_diagnosisEndocrine, not DM                                                    0.903650
## primary_diagnosisGenitourinary                                                        0.792083
## primary_diagnosisInjury                                                               0.802462
## primary_diagnosisMusculosceletal                                                      0.469759
## primary_diagnosisNeoplasm                                                             0.064854
## primary_diagnosisOther                                                                0.358366
## primary_diagnosisRespiratory                                                          4.28e-06
## primary_diagnosisSkin                                                                 0.055427
## primary_diagnosisSymptoms and ill_defined                                             0.369529
## ns(number_diagnoses, df = 5)1                                                         0.000465
## ns(number_diagnoses, df = 5)2                                                         0.002823
## ns(number_diagnoses, df = 5)3                                                         0.471085
## ns(number_diagnoses, df = 5)4                                                         0.116209
## ns(number_diagnoses, df = 5)5                                                         0.577598
## number_emergency1-5 emergency visits                                                  5.55e-15
## number_emergency6 and more emergency visits                                           0.003362
## insulinYes                                                                            0.081003
## DiabetesmedYes                                                                        3.28e-06
## gluc_testHigh                                                                         0.039900
## gluc_testNorm                                                                         0.030920
## metforminYes                                                                          1.93e-06
## glinidsYes                                                                            0.022411
## sulphonylureasYes                                                                     0.021514
## glitazonesYes                                                                         0.000760
## changeYes                                                                             0.030308
## age_catup to 100:number_inpatient1-5 inpatient visits                                 8.94e-10
## age_catup to 30:number_inpatient1-5 inpatient visits                                  0.000339
## age_catup to 100:number_inpatient6 and more inpatient visits                          0.000114
## age_catup to 30:number_inpatient6 and more inpatient visits                           0.005057
## number_inpatient1-5 inpatient visits:primary_diagnosisCirculatory                     0.003193
## number_inpatient6 and more inpatient visits:primary_diagnosisCirculatory              0.446674
## number_inpatient1-5 inpatient visits:primary_diagnosisDigestive                       0.618794
## number_inpatient6 and more inpatient visits:primary_diagnosisDigestive                0.462681
## number_inpatient1-5 inpatient visits:primary_diagnosisEndocrine, not DM               0.870140
## number_inpatient6 and more inpatient visits:primary_diagnosisEndocrine, not DM        0.023815
## number_inpatient1-5 inpatient visits:primary_diagnosisGenitourinary                   0.346051
## number_inpatient6 and more inpatient visits:primary_diagnosisGenitourinary            0.008840
## number_inpatient1-5 inpatient visits:primary_diagnosisInjury                          0.000771
## number_inpatient6 and more inpatient visits:primary_diagnosisInjury                   0.184056
## number_inpatient1-5 inpatient visits:primary_diagnosisMusculosceletal                 0.018066
## number_inpatient6 and more inpatient visits:primary_diagnosisMusculosceletal          0.704071
## number_inpatient1-5 inpatient visits:primary_diagnosisNeoplasm                        0.740100
## number_inpatient6 and more inpatient visits:primary_diagnosisNeoplasm                 0.199575
## number_inpatient1-5 inpatient visits:primary_diagnosisOther                           0.141379
## number_inpatient6 and more inpatient visits:primary_diagnosisOther                    0.459959
## number_inpatient1-5 inpatient visits:primary_diagnosisRespiratory                     0.734589
## number_inpatient6 and more inpatient visits:primary_diagnosisRespiratory              0.217702
## number_inpatient1-5 inpatient visits:primary_diagnosisSkin                            0.087809
## number_inpatient6 and more inpatient visits:primary_diagnosisSkin                     0.842844
## number_inpatient1-5 inpatient visits:primary_diagnosisSymptoms and ill_defined        0.091069
## number_inpatient6 and more inpatient visits:primary_diagnosisSymptoms and ill_defined       NA
## insulinYes:metforminYes                                                               0.060156
## insulinYes:glinidsYes                                                                 0.013420
## insulinYes:sulphonylureasYes                                                          0.698276
## insulinYes:glitazonesYes                                                              0.130889
##                                                                                          
## (Intercept)                                                                           ***
## raceAsian                                                                                
## raceCaucasian                                                                            
## raceHispanic                                                                             
## raceOther                                                                                
## age_catup to 100                                                                      ***
## age_catup to 30                                                                       ** 
## ns(time_in_hospital, df = 5)1                                                         ***
## ns(time_in_hospital, df = 5)2                                                         ***
## ns(time_in_hospital, df = 5)3                                                         ***
## ns(time_in_hospital, df = 5)4                                                         ***
## ns(time_in_hospital, df = 5)5                                                            
## num_lab_procedures                                                                       
## num_medications                                                                       ** 
## number_outpatient                                                                        
## number_inpatient1-5 inpatient visits                                                  ***
## number_inpatient6 and more inpatient visits                                           ***
## primary_diagnosisCirculatory                                                             
## primary_diagnosisDigestive                                                            ** 
## primary_diagnosisEndocrine, not DM                                                       
## primary_diagnosisGenitourinary                                                           
## primary_diagnosisInjury                                                                  
## primary_diagnosisMusculosceletal                                                         
## primary_diagnosisNeoplasm                                                             .  
## primary_diagnosisOther                                                                   
## primary_diagnosisRespiratory                                                          ***
## primary_diagnosisSkin                                                                 .  
## primary_diagnosisSymptoms and ill_defined                                                
## ns(number_diagnoses, df = 5)1                                                         ***
## ns(number_diagnoses, df = 5)2                                                         ** 
## ns(number_diagnoses, df = 5)3                                                            
## ns(number_diagnoses, df = 5)4                                                            
## ns(number_diagnoses, df = 5)5                                                            
## number_emergency1-5 emergency visits                                                  ***
## number_emergency6 and more emergency visits                                           ** 
## insulinYes                                                                            .  
## DiabetesmedYes                                                                        ***
## gluc_testHigh                                                                         *  
## gluc_testNorm                                                                         *  
## metforminYes                                                                          ***
## glinidsYes                                                                            *  
## sulphonylureasYes                                                                     *  
## glitazonesYes                                                                         ***
## changeYes                                                                             *  
## age_catup to 100:number_inpatient1-5 inpatient visits                                 ***
## age_catup to 30:number_inpatient1-5 inpatient visits                                  ***
## age_catup to 100:number_inpatient6 and more inpatient visits                          ***
## age_catup to 30:number_inpatient6 and more inpatient visits                           ** 
## number_inpatient1-5 inpatient visits:primary_diagnosisCirculatory                     ** 
## number_inpatient6 and more inpatient visits:primary_diagnosisCirculatory                 
## number_inpatient1-5 inpatient visits:primary_diagnosisDigestive                          
## number_inpatient6 and more inpatient visits:primary_diagnosisDigestive                   
## number_inpatient1-5 inpatient visits:primary_diagnosisEndocrine, not DM                  
## number_inpatient6 and more inpatient visits:primary_diagnosisEndocrine, not DM        *  
## number_inpatient1-5 inpatient visits:primary_diagnosisGenitourinary                      
## number_inpatient6 and more inpatient visits:primary_diagnosisGenitourinary            ** 
## number_inpatient1-5 inpatient visits:primary_diagnosisInjury                          ***
## number_inpatient6 and more inpatient visits:primary_diagnosisInjury                      
## number_inpatient1-5 inpatient visits:primary_diagnosisMusculosceletal                 *  
## number_inpatient6 and more inpatient visits:primary_diagnosisMusculosceletal             
## number_inpatient1-5 inpatient visits:primary_diagnosisNeoplasm                           
## number_inpatient6 and more inpatient visits:primary_diagnosisNeoplasm                    
## number_inpatient1-5 inpatient visits:primary_diagnosisOther                              
## number_inpatient6 and more inpatient visits:primary_diagnosisOther                       
## number_inpatient1-5 inpatient visits:primary_diagnosisRespiratory                        
## number_inpatient6 and more inpatient visits:primary_diagnosisRespiratory                 
## number_inpatient1-5 inpatient visits:primary_diagnosisSkin                            .  
## number_inpatient6 and more inpatient visits:primary_diagnosisSkin                        
## number_inpatient1-5 inpatient visits:primary_diagnosisSymptoms and ill_defined        .  
## number_inpatient6 and more inpatient visits:primary_diagnosisSymptoms and ill_defined    
## insulinYes:metforminYes                                                               .  
## insulinYes:glinidsYes                                                                 *  
## insulinYes:sulphonylureasYes                                                             
## insulinYes:glitazonesYes                                                                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for binomial family taken to be 1)
## 
##     Null deviance: 70810  on 100113  degrees of freedom
## Residual deviance: 68201  on 100041  degrees of freedom
## AIC: 68347
## 
## Number of Fisher Scoring iterations: 7
exp(coef(model_int))
##                                                                           (Intercept) 
##                                                                           0.036470088 
##                                                                             raceAsian 
##                                                                           0.998985661 
##                                                                         raceCaucasian 
##                                                                           1.007980127 
##                                                                          raceHispanic 
##                                                                           1.015437147 
##                                                                             raceOther 
##                                                                           0.910023061 
##                                                                      age_catup to 100 
##                                                                           1.351870853 
##                                                                       age_catup to 30 
##                                                                           0.719551532 
##                                                         ns(time_in_hospital, df = 5)1 
##                                                                           1.224154696 
##                                                         ns(time_in_hospital, df = 5)2 
##                                                                           1.293689054 
##                                                         ns(time_in_hospital, df = 5)3 
##                                                                           1.428859863 
##                                                         ns(time_in_hospital, df = 5)4 
##                                                                           1.478590553 
##                                                         ns(time_in_hospital, df = 5)5 
##                                                                           1.110719861 
##                                                                    num_lab_procedures 
##                                                                           1.000390105 
##                                                                       num_medications 
##                                                                           1.003999307 
##                                                                     number_outpatient 
##                                                                           0.995084143 
##                                                  number_inpatient1-5 inpatient visits 
##                                                                           2.633986356 
##                                           number_inpatient6 and more inpatient visits 
##                                                                           7.846552624 
##                                                          primary_diagnosisCirculatory 
##                                                                           1.022583805 
##                                                            primary_diagnosisDigestive 
##                                                                           0.830750105 
##                                                    primary_diagnosisEndocrine, not DM 
##                                                                           0.987634245 
##                                                        primary_diagnosisGenitourinary 
##                                                                           1.031280580 
##                                                               primary_diagnosisInjury 
##                                                                           1.015112820 
##                                                      primary_diagnosisMusculosceletal 
##                                                                           0.944379412 
##                                                             primary_diagnosisNeoplasm 
##                                                                           0.753723971 
##                                                                primary_diagnosisOther 
##                                                                           0.915134500 
##                                                          primary_diagnosisRespiratory 
##                                                                           0.740420563 
##                                                                 primary_diagnosisSkin 
##                                                                           1.506494015 
##                                             primary_diagnosisSymptoms and ill_defined 
##                                                                           1.406452720 
##                                                         ns(number_diagnoses, df = 5)1 
##                                                                           1.565918250 
##                                                         ns(number_diagnoses, df = 5)2 
##                                                                           1.644613384 
##                                                         ns(number_diagnoses, df = 5)3 
##                                                                           1.184001368 
##                                                         ns(number_diagnoses, df = 5)4 
##                                                                           1.773876276 
##                                                         ns(number_diagnoses, df = 5)5 
##                                                                           1.266100901 
##                                                  number_emergency1-5 emergency visits 
##                                                                           1.265213094 
##                                           number_emergency6 and more emergency visits 
##                                                                           1.456573127 
##                                                                            insulinYes 
##                                                                           0.887274991 
##                                                                        DiabetesmedYes 
##                                                                           1.345238176 
##                                                                         gluc_testHigh 
##                                                                           0.939075287 
##                                                                         gluc_testNorm 
##                                                                           0.916348056 
##                                                                          metforminYes 
##                                                                           0.773345613 
##                                                                            glinidsYes 
##                                                                           0.768402562 
##                                                                     sulphonylureasYes 
##                                                                           0.877037630 
##                                                                         glitazonesYes 
##                                                                           0.824739285 
##                                                                             changeYes 
##                                                                           1.068735665 
##                                 age_catup to 100:number_inpatient1-5 inpatient visits 
##                                                                           0.748462169 
##                                  age_catup to 30:number_inpatient1-5 inpatient visits 
##                                                                           1.774355491 
##                          age_catup to 100:number_inpatient6 and more inpatient visits 
##                                                                           0.582775277 
##                           age_catup to 30:number_inpatient6 and more inpatient visits 
##                                                                           1.952701776 
##                     number_inpatient1-5 inpatient visits:primary_diagnosisCirculatory 
##                                                                           0.789395462 
##              number_inpatient6 and more inpatient visits:primary_diagnosisCirculatory 
##                                                                           0.847972009 
##                       number_inpatient1-5 inpatient visits:primary_diagnosisDigestive 
##                                                                           0.954510438 
##                number_inpatient6 and more inpatient visits:primary_diagnosisDigestive 
##                                                                           1.174432645 
##               number_inpatient1-5 inpatient visits:primary_diagnosisEndocrine, not DM 
##                                                                           1.023814656 
##        number_inpatient6 and more inpatient visits:primary_diagnosisEndocrine, not DM 
##                                                                           0.331903449 
##                   number_inpatient1-5 inpatient visits:primary_diagnosisGenitourinary 
##                                                                           1.173757509 
##            number_inpatient6 and more inpatient visits:primary_diagnosisGenitourinary 
##                                                                           3.985748547 
##                          number_inpatient1-5 inpatient visits:primary_diagnosisInjury 
##                                                                           0.755178869 
##                   number_inpatient6 and more inpatient visits:primary_diagnosisInjury 
##                                                                           0.759073073 
##                 number_inpatient1-5 inpatient visits:primary_diagnosisMusculosceletal 
##                                                                           0.735274743 
##          number_inpatient6 and more inpatient visits:primary_diagnosisMusculosceletal 
##                                                                           1.205449610 
##                        number_inpatient1-5 inpatient visits:primary_diagnosisNeoplasm 
##                                                                           1.090644899 
##                 number_inpatient6 and more inpatient visits:primary_diagnosisNeoplasm 
##                                                                           2.818697817 
##                           number_inpatient1-5 inpatient visits:primary_diagnosisOther 
##                                                                           0.819764054 
##                    number_inpatient6 and more inpatient visits:primary_diagnosisOther 
##                                                                           1.288484146 
##                     number_inpatient1-5 inpatient visits:primary_diagnosisRespiratory 
##                                                                           1.031094490 
##              number_inpatient6 and more inpatient visits:primary_diagnosisRespiratory 
##                                                                           1.322561482 
##                            number_inpatient1-5 inpatient visits:primary_diagnosisSkin 
##                                                                           0.593312176 
##                     number_inpatient6 and more inpatient visits:primary_diagnosisSkin 
##                                                                           0.000164215 
##        number_inpatient1-5 inpatient visits:primary_diagnosisSymptoms and ill_defined 
##                                                                           0.157451785 
## number_inpatient6 and more inpatient visits:primary_diagnosisSymptoms and ill_defined 
##                                                                                    NA 
##                                                               insulinYes:metforminYes 
##                                                                           1.126723592 
##                                                                 insulinYes:glinidsYes 
##                                                                           1.417774558 
##                                                          insulinYes:sulphonylureasYes 
##                                                                           1.024776592 
##                                                              insulinYes:glitazonesYes 
##                                                                           1.108885606

Discussion

Of note: As this is not a real scientific paper - only brief discussion with limited amount of scientific data will be done The analysis has identified several predictors independently associated with diabetic patients´ readmission within 30-day interval after discharge from DM related hospitalization. These were: age and length of hospitalization, which is also in line with the recent meta-analysis Soh JGS, Wong WP, Mukhopadhyay A, Quek SC, Tai BC. Predictors of 30-day unplanned hospital readmission among adult patients with diabetes mellitus: a systematic review with meta-analysis. BMJ Open Diabetes Res Care. 2020 Aug;8(1):e001227. Moreover, increasing number of diagnoses, previous emergency, inpatient visits and prescription of antidiabetic medicines increased probability of re-hospitalization. These factors were not included in the meta-analysis cited above. These factors, generally, might reflect worse patients´underlying status, which might be true reason for 30-day readmission, however no variable like Charlson Comorbidity Index was available in the data set. This hypothesis might be further supported by the findings from the interaction model, where probability of being re-hospitalized increased in those 30 years and younger with number of previous inpatient stays. On the contrary, the same was not confirmed in the elderly, in whom number of inpatient visits decreased probability of being re-hospitalized within 30 days. The hypothesis is, that this might reflect more intensified care for patients with previous hospital stay/-s and closer observation of their health status. However, as patients who died during the index hospitalization were excluded from the data set (as a general), the analysis might be biased towards more fit elderly patients. Compared to meta-analysis, race was not found as a significant predictor, specific comorbidities and type of health insurance was not analysed in the current analysis. However, compared to patients with primary diagnosis DM, several primary diagnosis were associated with decreased probability of being re-hospitalized. Similarly to Beata Strack et al - patients in whom blood glucose test was done, had significantly lower probability of being re-hospitalized. There might be two possible explanations - the first is that patients in whom blood glucose test was done got re-evaluation of antidiabetic care, which translated into lower risk of readmission. The other reason might be residual confounding. Strength of the current analysis includes large data set covering period of 10 years, including numerous variables related to patients´ demographics, antidiabetic treatments and medical history. The limitation is, that data set is old, therefore current treatment of DM offers another pharmacological strategies, like dipeptidyl peptidase-4 inhibitors. Generalizability of the findings might be therefore limited. However, it must be mentioned, that medicines (e.g. metformin, sulphonylureas, insulin) from the data set used in the current analysis are still used and are part of best treatment guidelines 2023 ESC Guidelines for the management of cardiovascular disease in patients with diabetes. The other drawback is, that the data set does not provide dates for different events (or any specification of time relationship) - therefore it is unknown, whether blood glucose test was done before or after change of medications. Moreover, details on length of therapy, specific changes performed are not described. Information on adherence and patients´ behavior is missing like in most database data. Due to observational design of the study, no causal relationship cannot be determined.

Conclusion

In line with other research, age and length of stay were confirmed to be independent predictors of 30-day readmission in patients with diabetes mellitus.