BCE

Author

Violet, Carly, and Dari

Introduction

Missed appointments can delay medical care and make it harder for healthcare providers to use their time efficiently. By analyzing the relationship between multiple factors and appointment attendance, this project determines whether they are associated with a patient’s likelihood of missing an appointment.

Specifically, the factors we compared include age, alcoholism, gender, handicap, and SMS received. This information can be used to improve scheduling, reduce missed appointments, and make better use of available appointment times.

Variables and Level of Measurement

Levels of Measurement
Variable Level.of.Measurement
No.show Nominal (Binary)
Age Ratio
Gender Nominal (Binary)
Alcoholism Nominal (Binary)
Handcap Nominal (Binary)
SMS_received Nominal (Binary)
Diabetes Nominal (Binary)
Hipertension Nominal (Binary)

Qualitative and Quantitative

Using ScheduledDay, AppointmentDay, Neighbourhood as id variables

We imported the ‘Medical appointment no-shows’ data from Kaggle.

We split it into a qualitative and quantitive dataframes based on the variable type

  1. Quantitiave Vars: Age, PatientId, AppointmentID, AppointmentDay, ScheduledDay

  2. Qualtiative Vars: Gender, SMS_received, Scholarship, Hipertension, Diabetes, Alcoholism, Handcap, SMS_received, No.show

     Gender      SMS_received    Scholarship       Hipertension   
 Min.   :0.00   Min.   :0.000   Min.   :0.00000   Min.   :0.0000  
 1st Qu.:0.00   1st Qu.:0.000   1st Qu.:0.00000   1st Qu.:0.0000  
 Median :1.00   Median :0.000   Median :0.00000   Median :0.0000  
 Mean   :0.65   Mean   :0.321   Mean   :0.09827   Mean   :0.1972  
 3rd Qu.:1.00   3rd Qu.:1.000   3rd Qu.:0.00000   3rd Qu.:0.0000  
 Max.   :1.00   Max.   :1.000   Max.   :1.00000   Max.   :1.0000  
    Diabetes         Alcoholism        Handcap           No.show      
 Min.   :0.00000   Min.   :0.0000   Min.   :0.00000   Min.   :0.0000  
 1st Qu.:0.00000   1st Qu.:0.0000   1st Qu.:0.00000   1st Qu.:0.0000  
 Median :0.00000   Median :0.0000   Median :0.00000   Median :0.0000  
 Mean   :0.07186   Mean   :0.0304   Mean   :0.02028   Mean   :0.2019  
 3rd Qu.:0.00000   3rd Qu.:0.0000   3rd Qu.:0.00000   3rd Qu.:0.0000  
 Max.   :1.00000   Max.   :1.0000   Max.   :1.00000   Max.   :1.0000  

Graphs

Covariance and Correlation

Age

[1] -0.5596021
[1] -0.06031851

Gender

[1] 0.0007886373
[1] 0.004118633

Alcoholism

[1] -1.351175e-05
[1] -0.0001960437

Handcap

[1] -0.0004119471
[1] -0.007280746

SMS_received

[1] 0.02369604
[1] 0.1264307

Residuals


Call:
lm(formula = No.show ~ Age, data = original)

Residuals:
    Min      1Q  Median      3Q     Max 
-0.2418 -0.2167 -0.1905 -0.1633  0.8797 

Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept)  2.408e-01  2.279e-03  105.65   <2e-16 ***
Age         -1.048e-03  5.216e-05  -20.09   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.4007 on 110525 degrees of freedom
Multiple R-squared:  0.003638,  Adjusted R-squared:  0.003629 
F-statistic: 403.6 on 1 and 110525 DF,  p-value: < 2.2e-16
     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
-0.001048 -0.001048 -0.001048 -0.001048 -0.001048 -0.001048 

Call:
lm(formula = No.show ~ Gender, data = original)

Residuals:
    Min      1Q  Median      3Q     Max 
-0.2031 -0.2031 -0.2031 -0.1997  0.8003 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 0.199679   0.002041  97.835   <2e-16 ***
Gender      0.003466   0.002532   1.369    0.171    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.4014 on 110525 degrees of freedom
Multiple R-squared:  1.696e-05, Adjusted R-squared:  7.916e-06 
F-statistic: 1.875 on 1 and 110525 DF,  p-value: 0.1709
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
0.003466 0.003466 0.003466 0.003466 0.003466 0.003466 

Call:
lm(formula = No.show ~ Alcoholism, data = original)

Residuals:
    Min      1Q  Median      3Q     Max 
-0.2019 -0.2019 -0.2019 -0.2019  0.7985 

Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept)  0.2019465  0.0012263 164.680   <2e-16 ***
Alcoholism  -0.0004584  0.0070333  -0.065    0.948    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.4014 on 110525 degrees of freedom
Multiple R-squared:  3.843e-08, Adjusted R-squared:  -9.009e-06 
F-statistic: 0.004248 on 1 and 110525 DF,  p-value: 0.948
      Min.    1st Qu.     Median       Mean    3rd Qu.       Max. 
-0.0004584 -0.0004584 -0.0004584 -0.0004584 -0.0004584 -0.0004584 

Call:
lm(formula = No.show ~ Handcap, data = original)

Residuals:
    Min      1Q  Median      3Q     Max 
-0.2024 -0.2024 -0.2024 -0.2024  0.8184 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  0.202353   0.001220 165.875   <2e-16 ***
Handcap     -0.020738   0.008567  -2.421   0.0155 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.4014 on 110525 degrees of freedom
Multiple R-squared:  5.301e-05, Adjusted R-squared:  4.396e-05 
F-statistic: 5.859 on 1 and 110525 DF,  p-value: 0.0155
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
-0.02074 -0.02074 -0.02074 -0.02074 -0.02074 -0.02074 

Call:
lm(formula = No.show ~ SMS_received, data = original)

Residuals:
    Min      1Q  Median      3Q     Max 
-0.2757 -0.1670 -0.1670 -0.1670  0.8330 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept)  0.167033   0.001454  114.90   <2e-16 ***
SMS_received 0.108712   0.002566   42.37   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.3982 on 110525 degrees of freedom
Multiple R-squared:  0.01598,   Adjusted R-squared:  0.01598 
F-statistic:  1795 on 1 and 110525 DF,  p-value: < 2.2e-16
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.1087  0.1087  0.1087  0.1087  0.1087  0.1087 

Summary Stats


Summary Statistics
===========================================
Statistic       N    Mean  St. Dev. Min Max
-------------------------------------------
No.show      110,527 0.20    0.40    0   1 
Age          110,527 37.09  23.11   -1  115
Gender       110,527 0.65    0.48    0   1 
Alcoholism   110,527 0.03    0.17    0   1 
Handcap      110,527 0.02    0.14    0   1 
SMS_received 110,527 0.32    0.47    0   1 
-------------------------------------------

Regression Results
==========================================================
                          Dependent variable:             
             ---------------------------------------------
                                No.show                   
              Model 1  Model 2  Model 3                   
                (1)      (2)      (3)      (4)      (5)   
----------------------------------------------------------
Age          -0.001***                                    
             (0.0001)                                     
                                                          
Gender                  0.003                             
                       (0.003)                            
                                                          
Alcoholism                      -0.0005                   
                                (0.007)                   
                                                          
Handicap                                 -0.021**         
                                         (0.009)          
                                                          
SMS Received                                      0.109***
                                                  (0.003) 
                                                          
Constant     0.241***  0.200*** 0.202*** 0.202*** 0.167***
              (0.002)  (0.002)  (0.001)  (0.001)  (0.001) 
                                                          
----------------------------------------------------------
Observations  110,527  110,527  110,527  110,527  110,527 
R2             0.004   0.00002  0.00000   0.0001   0.016  
Adjusted R2    0.004   0.00001  -0.00001 0.00004   0.016  
==========================================================
Note:                          *p<0.1; **p<0.05; ***p<0.01

Equation

\[ \text{No.show}_i = \beta_0 + \beta_1\text{Age}_i + \beta_2\text{Gender}_i + \beta_3\text{Alcoholism}_i + \beta_4\text{Handcap}_i + \beta_5\text{SMS\_received}_i + \varepsilon_i \]