Load the dataset and view a summary of the data:

wait_times <- read.csv(file = "/Users/carandangc/Desktop/ns_surgery_wait_times/Surgical_Wait_Times_20181118.csv", header = TRUE, sep = ",")
summary(wait_times)
##              Period                      Specialty   
##  12month_rolling:2229                         :4890  
##  2017_q2        : 466   General Surgery       : 557  
##  2016_q4        : 463   Orthopaedic           : 254  
##  2017_q1        : 463   Obstetrics/Gynaecology: 211  
##  2018_q2        : 463   Urology               : 200  
##  2017_q4        : 462   Otolaryngology (ENT)  : 151  
##  (Other)        :2161   (Other)               : 444  
##                                 Procedure   
##  All                                 : 296  
##  Hernia Repair  (Adult)              : 183  
##  Hernia Repair - Inguinal/Femoral    : 165  
##  Gallbladder Surgery                 : 164  
##  Hysterectomy  (Cancer Not Suspected): 162  
##  Hysteroscopy                        : 150  
##  (Other)                             :5587  
##                     Provider        Zone                      Facility   
##                         :4916         :1817                       :1817  
##  Wasserman, Lukas       :  21   IWK   : 241   Provincial          :1322  
##  Hoogerboord, C Marius  :  17   Total :1322   QE2                 : 963  
##  Clark, F Donald        :  16   Zone 1: 799   Valley Regional     : 397  
##  Alawashez, Abdulrahim S:  15   Zone 2: 469   Cape Breton Regional: 327  
##  Archibald, Alison      :  14   Zone 3: 742   Dartmouth General   : 312  
##  (Other)                :1708   Zone 4:1317   (Other)             :1569  
##       Year         Quarter      Consult_Median     Consult_90th   
##  Min.   :2016   Min.   :1.000   Min.   :   1.00   Min.   :   1.0  
##  1st Qu.:2017   1st Qu.:2.000   1st Qu.:  22.00   1st Qu.:  62.0  
##  Median :2017   Median :3.000   Median :  42.00   Median : 127.0  
##  Mean   :2017   Mean   :2.623   Mean   :  62.98   Mean   : 182.1  
##  3rd Qu.:2018   3rd Qu.:3.000   3rd Qu.:  78.00   3rd Qu.: 220.2  
##  Max.   :2018   Max.   :4.000   Max.   :2032.00   Max.   :3282.0  
##  NA's   :1791   NA's   :1791    NA's   :979       NA's   :979     
##  Surgery_Median     Surgery_90th   
##  Min.   :   0.00   Min.   :   4.0  
##  1st Qu.:  32.00   1st Qu.:  79.0  
##  Median :  52.00   Median : 137.0  
##  Mean   :  73.88   Mean   : 182.4  
##  3rd Qu.:  91.00   3rd Qu.: 229.0  
##  Max.   :1167.00   Max.   :2025.0  
##  NA's   :149       NA's   :149

Let’s look at each of the variables from the above summary and visualize them:

print("Period")
## [1] "Period"
table(wait_times$Period)
## 
## 12month_rolling         2016_q3         2016_q4         2017_q1 
##            2229             461             463             463 
##         2017_q2         2017_q3         2017_q4         2018_q1 
##             466             458             462             461 
##         2018_q2         2018_q3  3month_rolling 
##             463             453             328
counts <- table(wait_times$Period)
barplot(counts, main="Wait Times", xlab="Period")

From the table and bar graph above, we see that the quarterly wait times (in days) are similar in magnitude, and the 12month_rolling wait time is much larger than the 3month_rolling wait time.

print("Specialty")
## [1] "Specialty"
table(wait_times$Specialty)
## 
##                               All Specialties        Cardiac Surgery 
##                   4890                      2                     43 
##                 Dental        General Surgery           Neurosurgery 
##                     36                    557                     42 
## Obstetrics/Gynaecology          Ophthalmology Oral and Maxillofacial 
##                    211                    101                      2 
##     Oral Maxillofacial            Orthopaedic    Orthopaedic Surgery 
##                     41                    254                      2 
##   Otolaryngology (ENT)        Plastic Surgery       Thoracic Surgery 
##                    151                     98                     32 
##                Urology       Vascular Surgery 
##                    200                     45
counts <- table(wait_times$Specialty)
barplot(counts, main="Wait Times", xlab="Specialty")

From the table and bar graph above, we see that General Surgery has the highest wait time, while All Specialties, Oral and Maxillofacial, and Orthopaedic Surgery have the lowest. These lowest values are most likely from an error, and these 3 variables most likely belong to another group (All Specialities most likely is the column with no heading; Oral and Maxillofacial should be with Oral Maxillofacial, and Orthopaedic Surgery should be with Orthopaedic). So the next variable with the lowest wait time is Dental.

print("Procedure")
## [1] "Procedure"
table(wait_times$Procedure)
## 
##                                                                         
##                                                                      26 
##                                                         Adrenal Surgery 
##                                                                       3 
##                                                       Aesthetic Surgery 
##                                                                      23 
##                                                                     All 
##                                                                     296 
##                                                             Amputations 
##                                                                      24 
##                                                         Aneurysm Repair 
##                                                                      37 
##                                                             Angioplasty 
##                                                                      24 
##                                                     Ankle - Arthrodesis 
##                                                                      21 
##                                                    Ankle - Arthroplasty 
##                                                                       3 
##                                                     Ankle - Arthroscopy 
##                                                                      23 
##                                             AV Fistula Creation/Closure 
##                                                                      38 
##                                                   Back Surgery  (Adult) 
##                                                                      29 
##                                               Back Surgery  (Pediatric) 
##                                                                      22 
##                                     Bariatric Surgery (for Weight Loss) 
##                                                                      21 
##                                                  Bladder Cancer Surgery 
##                                                                      82 
##                                                         Bladder Surgery 
##                                                                      28 
##                                      Bone-Anchored Hearing Aid  (Adult) 
##                                                                       2 
##                                                  Bone / Cartilage Graft 
##                                                                      31 
##                                                         Bowel Resection 
##                                                                     132 
##                                          Bowel Resection - Laparoscopic 
##                                                                      68 
##                                                  Bowel Resection - Open 
##                                                                      99 
##                                                  Brain Surgery  (Adult) 
##                                                                      27 
##                                              Brain Surgery  (Pediatric) 
##                                                                      22 
##                                                     Breast Augmentation 
##                                                                       6 
##                                                   Breast Cancer Surgery 
##                                                                     113 
##                                                   Breast Reconstruction 
##                                                                      26 
##                                                Breast Reduction Surgery 
##                                                                      31 
##                                               Cardiac Valve Replacement 
##                                                                      27 
##                                                  Cardiovascular Surgery 
##                                                                      28 
##                                                  Carotid Endarterectomy 
##                                                                      24 
##                                                   Carpal Tunnel Surgery 
##                                                                      90 
##                                                        Cataract Surgery 
##                                                                     133 
##                                           Cervical Spine (Neck) Surgery 
##                                                                      27 
##                                                   Chest Scopes  (Adult) 
##                                                                       3 
##                                           Cleft Lip/Palate  (Pediatric) 
##                                                                       1 
##                                               Colorectal Cancer Surgery 
##                                                                     106 
##                                                Congenital Heart Surgery 
##                                                                       2 
##                                             Cornea and External Disease 
##                                                                      21 
##                                            Coronary Artery Bypass Graft 
##                                                                      27 
##                                                 Craniotomy for Epilepsy 
##                                                                       3 
##                                               Craniotomy or Craniectomy 
##                                                                       5 
##                                                              Cystoscopy 
##                                                                     128 
##                            Dental Extractions and Restorations  (Adult) 
##                                                                      77 
##                        Dental Extractions and Restorations  (Pediatric) 
##                                                                      93 
##                                                      Ear Tubes  (Adult) 
##                                                                      18 
##                                                  Ear Tubes  (Pediatric) 
##                                                                      73 
##                                                          Endarterectomy 
##                                                                      26 
##                                                    Endometrial Ablation 
##                                                                      72 
##                                                                    ERCP 
##                                                                      22 
##                                      Esophagectomy / Esophageal Surgery 
##                                                                      23 
##                                               Excision Morton's Neuroma 
##                                                                       2 
##                                             Female Incontinence Surgery 
##                                                                      53 
##                                                      Foot - Arthrodesis 
##                                                                      34 
##                                                     Foot - Arthroplasty 
##                                                                      14 
##                                                     Foot - Bunionectomy 
##                                                                      33 
##                                                        Foot - Osteotomy 
##                                                                      12 
##                                                   Foot - Reconstruction 
##                                                                       3 
##                              Functional Endoscopic Sinus Surgery (FESS) 
##                                                                      52 
##                                                     Gallbladder Surgery 
##                                                                     164 
##                                                         Gastric Surgery 
##                                                                      37 
##                                          Gastric Surgery - Laparoscopic 
##                                                                      29 
##                                          Gastrointestinal Tract Surgery 
##                                                                     120 
##                           Gastrointestinal Tract Surgery - Laparoscopic 
##                                                                      68 
##                                Glaucoma (Eye Pressure Lowering Surgery) 
##                                                                      26 
##                                                  Hand / Upper Extremity 
##                                                                      38 
##                                                   Head and Neck Surgery 
##                                                                      37 
##                                                        Hemorrhoidectomy 
##                                                                      31 
##                                              Hernia Repair - Incisional 
##                                                                      82 
##                                        Hernia Repair - Inguinal/Femoral 
##                                                                     165 
##                                 Hernia Repair - Laparoscopic Incisional 
##                                                                      24 
##                           Hernia Repair - Laparoscopic Inguinal Femoral 
##                                                                      50 
##                                  Hernia Repair - Laparoscopic Umbilical 
##                                                                      17 
##                                    Hernia Repair - Laparoscopic Ventral 
##                                                                      18 
##                                              Hernia Repair - Parastomal 
##                                                                       2 
##                                               Hernia Repair - Umbilical 
##                                                                     107 
##                                                 Hernia Repair - Ventral 
##                                                                      24 
##                                                  Hernia Repair  (Adult) 
##                                                                     183 
##                                              Hernia Repair  (Pediatric) 
##                                                                      23 
##                                                         Hip Arthroscopy 
##                                                                      35 
##                                                         Hip Replacement 
##                                                                      85 
##                                                Hip Replacement Revision 
##                                                                      26 
##                                    Hysterectomy  (Cancer Not Suspected) 
##                                                                     162 
##                              Hysterectomy  (Cancer Suspected or Proven) 
##                                                                      28 
##                                                            Hysteroscopy 
##                                                                     150 
##                                      Insertion Vascular Access Catheter 
##                                                                      49 
##                                Internal Defib Insertion / Loop Recorder 
##                                                                      24 
##                                            Kidney / Upper Urinary Tract 
##                                                                      45 
##                                                          Kidney Removal 
##                                                                      50 
##                                                    Kidney Stone Surgery 
##                                                                      57 
##                                                        Knee Replacement 
##                                                                      86 
##                                              Knee Replacement - Partial 
##                                                                      45 
##                                               Knee Replacement Revision 
##                                                                      30 
##                                                              Knee Scope 
##                                                                     137 
##                                              Knee Scope with ACL Repair 
##                                                                      40 
##                                                   Lacrimal Duct Probing 
##                                                                      24 
##                                      Laryngology and Vocal Cord Surgery 
##                                                                      41 
##                                                           Liver Surgery 
##                                                                      24 
##                                                     Lung Cancer Surgery 
##                                                                      24 
##                                                            Lung Surgery 
##                                                                      24 
##                                                       Lymph Node Biopsy 
##                                                                      30 
##                                              Male Circumcision  (Adult) 
##                                                                      50 
##                                          Male Circumcision  (Pediatric) 
##                                                                      25 
##                                               Male Incontinence Surgery 
##                                                                       3 
##                                        Male Reproductive System Surgery 
##                                                                     129 
##                                               Manipulation of Extremity 
##                                                                      18 
##                                         Maxillofacial Deformity Surgery 
##                                                                      39 
##                                                       Melanoma Excision 
##                                                                      28 
##                                                            Meniscectomy 
##                                                                       5 
##                                              Nerve or Brain Stimulation 
##                                                                       3 
##                                                           Nerve Surgery 
##                                                                      37 
##                                    Nissen Fundoplication - Laparoscopic 
##                                                                      29 
##                                            Nissen Fundoplication - Open 
##                                                                       3 
##                              Nose Surgery - Reconstructive or Aesthetic 
##                                                                       3 
##                                                   Oculo Plastic Surgery 
##                                                                      20 
##                                                      Orthopaedic Trauma 
##                                                                      44 
##                                                               Osteotomy 
##                                                                      15 
##                                                               Otoplasty 
##                                                                       4 
##                                                     Pacemaker Insertion 
##                                                                      30 
##                          Palmar Fascia Excision for Dupuytren's Disease 
##                                                                      39 
##                                                        Pancreas Surgery 
##                                                                      23 
##                                                         Patella Surgery 
##                                                                       5 
##                                                     Pelvic Floor Repair 
##                                                                      43 
##                                      Peritoneal Lavage or Catherization 
##                                                                      22 
##                                                  Pilonidal Cyst Surgery 
##                                                                      19 
##                                                 Prostate Cancer Surgery 
##                                                                      28 
##                                                        Prostate Surgery 
##                                                                      82 
##                                                           Prostatectomy 
##                                                                      28 
##       Removal of Ovaries and/or Fallopian Tubes  (Cancer Not Suspected) 
##                                                                      49 
## Removal of Ovaries and/or Fallopian Tubes  (Cancer Suspected or Proven) 
##                                                                       2 
##                                       Repair Facial / Orbital Fractures 
##                                                                       1 
##                                                Sacral Nerve Stimulation 
##                                                                      22 
##                                                  Salivary Gland Surgery 
##                                                                      16 
##                                                             Septoplasty 
##                                                                      75 
##                                                   Shoulder Arthroplasty 
##                                                                      37 
##                                                    Shoulder Arthroscopy 
##                                                                     103 
##                                                        Shoulder Surgery 
##                                                                      39 
##                                                           Sinus Surgery 
##                                                                      15 
##                                         Spinal Cord Stimulation Surgery 
##                                                                      20 
##                                                         Splenic Surgery 
##                                                                       3 
##                                                Sternotomy / Thoracotomy 
##                                                                       4 
##                                             Strabismus Surgery  (Adult) 
##                                                                      24 
##                                         Strabismus Surgery  (Pediatric) 
##                                                                      24 
##                      Surgery for Hearing or Balance Problems of the Ear 
##                                                                     102 
##                                                       Tear Duct Surgery 
##                                                                      20 
##                                   Temperomandibular Joint Surgery (TMJ) 
##                                                                      24 
##                                                  Temporal Artery Biopsy 
##                                                                       3 
##                                                Tendon / Ligament Repair 
##                                                                      74 
##                                                Thoroscopy / Pleuroscopy 
##                                                                       3 
##                                                              Thymectomy 
##                                                                       3 
##                                          Thyroid or Parathyroid Surgery 
##                                                                      52 
##                             Tonsillectomy and/or Adenoidectomy  (Adult) 
##                                                                      42 
##                         Tonsillectomy and/or Adenoidectomy  (Pediatric) 
##                                                                      62 
##                                                          Tubal Ligation 
##                                                                      48 
##                                                          Varicose Veins 
##                                                                      23 
##                                                 Vascular Bypass Surgery 
##                                                                      22 
##                                         Video-Assisted Thoracic Surgery 
##                                                                      24 
##                                                  Vitreoretinal Diseases 
##                                                                      26 
##                                                      Whipple Procedures 
##                                                                       5 
##                                                        Wound Management 
##                                                                      16
counts <- table(wait_times$Procedure)
barplot(counts, main="Wait Times", xlab="Procedure")

In the table and bar graph above, the highest wait times were associated with All and Hernia Repair - Inguinal/Femoral, while there were several less common procedures (ie Temporal Artery Biopsy) which had a wait time of 1.

print("Provider")
## [1] "Provider"
table(wait_times$Provider)
## 
##                                        
##                                   4916 
##              Abdul Kadir, Najeeb Ahmed 
##                                     12 
##                       Abutu, Natheniel 
##                                      5 
##                         Alant, Jacob D 
##                                      5 
##                Alawashez, Abdulrahim S 
##                                     15 
##          Albahiti, Mohamed Tawfik Akif 
##                                      2 
##                       Albert, Daniel N 
##                                      2 
##                           Ali, Idris M 
##                                      6 
##             Alshareef, Rayan Abdulaziz 
##                                      2 
##                          Amir, Baharak 
##                                      5 
##                      Anderson, Peter A 
##                                      5 
##                      Archibald, Alison 
##                                     14 
##                      Archibald, Curtis 
##                                      5 
##                           Asim, Hammad 
##                                     11 
##                  Atiyah, Abdulrazzak O 
##                                      9 
##                         Bailly, Greg G 
##                                      8 
##                       Balys, Richard L 
##                                      8 
##                            Barry, Sean 
##                                      4 
##                       Baskett, Roger J 
##                                      4 
##                           Belen, Jaime 
##                                      1 
##                          Bell, David G 
##                                     10 
##                      Belliveau, Daniel 
##                                      2 
##                 Bendor-Samuel, Richard 
##                                      2 
##                           Bent, Alfred 
##                                      3 
##                       Bentley, James R 
##                                      5 
##                    Beveridge,William K 
##                                      7 
##                       Bezuhly, Michael 
##                                      8 
##                 Biddulph, Michael Paul 
##                                      6 
##                         Boileau, Louis 
##                                      5 
##                  Boudreau, Dennis Todd 
##                                      6 
##                         Bourget, Louis 
##                                      4 
##                         Bourque, Susan 
##                                      5 
##                        Bouzayen, Renda 
##                                      3 
##                           Brady, James 
##                                      4 
##                       Brennan, Michael 
##                                     11 
##                           Briand, Beth 
##                                      2 
##                        Brien, Donald M 
##                                     10 
##                         Brodarec, Ivan 
##                                     10 
##                        Brooks, Melissa 
##                                      4 
##                       Brown, Charlotte 
##                                      3 
##                         Brown, Timothy 
##                                      2 
##                         Butler, Clay K 
##                                     14 
##                         Butler, Trevor 
##                                     11 
##                  Calverley, Virginia C 
##                                      3 
##                       Carrillo, Monica 
##                                      3 
##                       Casey, Patrick J 
##                                      4 
##                        Chedrawy, Edgar 
##                                      6 
##                         Cheevers, Paul 
##                                      2 
##                         Chiarot, Marco 
##                                      4 
##                  Chokshi, Rashmikant G 
##                                      8 
##                       Christie, Sean D 
##                                      4 
##                         Chun, Samuel S 
##                                      7 
##                  Clague, Nicholas Paul 
##                                      7 
##                        Clark, F Donald 
##                                     16 
##                        Clarke, David B 
##                                      3 
##                        Clarke, Gregory 
##                                      6 
##                          Clifton, Neil 
##                                      7 
##                     Coady, Catherine M 
##                                      4 
##                          Cohen, Elissa 
##                                      3 
##                          Coles, Chad P 
##                                      2 
##                        Comstock, David 
##                                      3 
##                           Coolen, Anna 
##                                      6 
##                      Corsten, P Gerard 
##                                      6 
##                            Cox, Ashley 
##                                     10 
##                        Curry, Philip L 
##                                      9 
##                          Cyr, Philip L 
##                                      4 
##                      Dahrab, Mishari M 
##                                      4 
##                            Dakin, Todd 
##                                      3 
##                         Davidson, Dion 
##                                      9 
##               Davies, Dafydd Alexander 
##                                      7 
##                        Davis, Benjamin 
##                                      3 
##                        Davis, George R 
##                                      5 
## de Saint Sardos, Alexandre Guy William 
##                                      2 
##                         Dempsey, Ian M 
##                                      7 
##                      Dickinson, John D 
##                                      3 
##                    Dickson, Lisa Marie 
##                                      5 
##                            Dodd, Faith 
##                                      8 
##                   Doucet, Jean-Charles 
##                                      6 
##                           Doyle, Ian M 
##                                      3 
##                           Doyle, Tracy 
##                                      2 
##                      Dunbar, Michael J 
##                                      5 
##                            Dunn, Rex S 
##                                      3 
##                        Dyment, Heather 
##                                      3 
##                  Dzierzanowski, Martin 
##                                     10 
##                         Eadie, Brennan 
##                                      3 
##                          Edgar, Dawn C 
##                                      5 
##                        El-Hawary, Rany 
##                                      4 
##                    El-Tahan, Tahmir H. 
##                                      9 
##                      Ellsmere, James C 
##                                      9 
##                Enright, Jonathan Boyde 
##                                     14 
##                 Faryniuk, Andrea Marie 
##                                      7 
##                           Fossen, Noha 
##                                      5 
##                  French, Daniel Gerard 
##                                      7 
##                      Gajewski, Jerzy B 
##                                      4 
##                      Gala Lopez, Boris 
##                                     10 
##                  Gauthier, Luke Edward 
##                                      3 
##                        George, Stanley 
##                                      2 
##          Giacomantonio, Carman Anthony 
##                                      4 
##                          Gillis, Megan 
##                                      5 
##                         Gilmour, Donna 
##                                      4 
##                     Glazebrook, Mark A 
##                                     10 
##                Glennie, Raymond Andrew 
##                                      3 
##                      Goodday, Reginald 
##                                      3 
##                      Grantmyre, John E 
##                                      7 
##                       Gregoire, Curtis 
##                                      5 
##                     Grimshaw, Robert N 
##                                      4 
##                         Gross, Michael 
##                                      6 
##                     Gupta, Rudra Rishi 
##                                      3 
##                         Hamilton, John 
##                                      2 
##                       Hammel,  Kenneth 
##                                      2 
##                        Hassan, Abdalla 
##                                      4 
##                          Hayden, David 
##                                      9 
##                        Hayward, Andrew 
##                                      6 
##                      Heisler, Benjamin 
##                                     12 
##                         Helyer, Lucy K 
##                                      8 
##                     Henteleff, Harry J 
##                                      7 
##                      Herman, Christine 
##                                      8 
##                         Hewins, Edward 
##                                     10 
##              Himmelman, Jeffrey George 
##                                      6 
##                      Hirsch, Gregory M 
##                                      6 
##                             Hong, Paul 
##                                      4 
##                  Hoogerboord, C Marius 
##                                     17 
##                          Houck, Leslie 
##                                      4 
##                           Howatt, Eric 
##                                      9 
##                        Hurley, Richard 
##                                      3 
##                   Hussain, Ahsen Ayyaz 
##                                      5 
##                         Johnson, Kevin 
##                                     10 
##                         Johnson, Liane 
##                                      4 
##                        Johnson, Paul M 
##                                      8 
##                      Johnston, David G 
##                                      7 
##                            Jony, Louai 
##                                      5 
##                       Jorgensen, Sally 
##                                      4 
##                     Joshi, Changulanda 
##                                      6 
##                            Joy, Edward 
##                                     10 
##                        Kapasi, Mustafa 
##                                      2 
##                         Kasi, Anushuya 
##                                      6 
##                    Kelly, Ryan Patrick 
##                                     14 
##                          Kenyon, Chris 
##                                      7 
##                    Kieser, Katharina E 
##                                      4 
##                      Klassen, Dennis R 
##                                      9 
##                      Kujath, Magdalena 
##                                     12 
##                        Lakosha, Hesham 
##                                      2 
##                          Lamey, Alicia 
##                                     12 
##                          Lantz, Andrea 
##                                      3 
##                    Lapierre, Stephanie 
##                                      6 
##                      Laroche, G Robert 
##                                      3 
##                        Lawen, Joseph G 
##                                     11 
##                        LeBlanc, Martin 
##                                      8 
##                       LeBlanc, Robin B 
##                                      7 
##                             Lee, Min S 
##                                      7 
##                        Lee, Winifred W 
##                                      5 
##                            Lefel, Oleg 
##                                     13 
##                       Legay, Douglas A 
##                                      7 
##               Leighton, Jennifer Laura 
##                                      3 
##                       Leighton, Ross K 
##                                      5 
##                         Lewis, Darrell 
##                                      2 
##                     Livingstone, Scott 
##                                      9 
##                       Logan, Karl John 
##                                      6 
##                       MacDonald, Blair 
##                                     11 
##               MacDonald, Joseph Gerard 
##                                      6 
##                      MacFarlane, David 
##                                      5 
##             MacGillivray, Barbara Jean 
##                                      3 
##                      MacIntosh, Alan B 
##                                      3 
##                      MacKean, Gerald L 
##                                      6 
##                        MacLellan, Dawn 
##                                      5 
##                    MacLellan, Jennifer 
##                                      2 
##                    MacQuarrie, Robyn M 
##                                      4 
##                      Malenfant, Deanne 
##                                      3 
##                         Malik, Hatim G 
##                                      4 
##                            Mann, Colin 
##                                      2 
##                            Mason, Ross 
##                                      7 
##                         Massaro, Peter 
##                                     11 
##                        Massoud, Emad A 
##                                      5 
##                            Matei, Anca 
##                                      5 
##                      Mawdsley, Scott D 
##                                      4 
##                      Mayer, Kristine L 
##                                      3 
##                    McCarthy, John Paul 
##                                     12 
##                       McCarthy, Leanne 
##                                      3 
##                       McGibney, Kieron 
##                                     12 
##                        McGory,Rodney W 
##                                     10 
##                     McKenney, Roderick 
##                                     12 
##                      McNeely, P Daniel 
##                                      3 
##                        McPherson, John 
##                                      7 
##                          Mello, Isabel 
##                                      2 
##                         Miller, M Dale 
##                                     13 
##                  Mills, Jessica Louise 
##                                      5 
##                          Minor, Samuel 
##                                     10 
##                            Mishra, Anu 
##                                      2 
##                       Mitchell, Alex D 
##                                      6 
##                     Moodley, Manivasan 
##                                      4 
##                           Morash, Joel 
##                                     11 
##                        Morris, David P 
##                                      3 
##                       Morris, Steven F 
##                                      5 
##                Mujoomdar, Aneil Arvind 
##                                     10 
##                          Munro, Monica 
##                                      2 
##                        Murdoch, John L 
##                                     13 
##                    Murphy, Christopher 
##                                     12 
##                         Murphy, Jeremy 
##                                      2 
##                        Murphy, Nadia L 
##                                      6 
##                          Murray, Angus 
##                                      5 
##                           Nader, Nabil 
##                                     10 
##                         Nette, Farrell 
##                                      6 
##                      Neumann, Katerina 
##                                      7 
##                      Nicolela, Marcelo 
##                                      3 
##                O'Brien, Daniel Michael 
##                                      3 
##                       O'Brien, David A 
##                                      7 
##                      O'Joleck, Michael 
##                                      2 
##                      O'Malley, Padraic 
##                                      9 
##                       O'Neill, Brendan 
##                                      4 
##                    O'Neill, Michelle E 
##                                      4 
##                  O'Sullivan, Colleen M 
##                                     12 
##                       Okuboyejo, Fazil 
##                                      5 
##                        Orlik, Benjamin 
##                                      6 
##                          Orr, Andrew C 
##                                      2 
##                        Orrell, Kevin G 
##                                      9 
##                       Osasere, Michael 
##                                      5 
##                  Owen, Stephen Maldwyn 
##                                      6 
##                         Oxner, William 
##                                      2 
##                          Padmore, Dave 
##                                      6 
##                       Paletz, Justin L 
##                                      5 
##                          Palmer, Bruce 
##                                      7 
##                      Parish, Barbara M 
##                                      3 
##                       Pickett, Gwynedd 
##                                      5 
##                       Pierce, Marianne 
##                                      6 
##                 Pillai, Neelakantan G. 
##                                      8 
##                           Pink, Philip 
##                                      7 
##                   Plourde, Madelaine M 
##                                      6 
##                     Porter, Geoffrey A 
##                                      8 
##                           Powell, Joel 
##                                      2 
##                     Proctor, Irma Joan 
##                                     11 
##                           Pugh, Cheryl 
##                                      6 
##                  Puthenparumpil, Jacob 
##                                      8 
##                         Rafuse, Paul E 
##                                      3 
##                      Randle, Elizabeth 
##                                      3 
##                      Reardon, Gerald P 
##                                      7 
##                           Redwan, Hani 
##                                     10 
##                        Rendon, Ricardo 
##                                     10 
##                          Rent, Kenneth 
##                                     12 
##           Richardson, Christopher Glen 
##                                      6 
##                    Rigby, Matthew Hall 
##                                      5 
##                      Rittenberg, David 
##                                      4 
##                      Robertson, Chad G 
##                                      2 
##                     Robitaille, Johane 
##                                      3 
##                          Rogers, Jamie 
##                                      2 
##                    Romao, Rodrigo Luiz 
##                                      9 
##                            Ross, Ian W 
##                                      4 
##                        Rudd, Michael W 
##                                      8 
##                            Samad, Arif 
##                                      3 
##                        Sandland, Helen 
##                                      4 
##                          Scott, Robert 
##                                      2 
##                       Scott, Stephanie 
##                                      4 
##                   Seamone, Christopher 
##                                      3 
##                   Sequeira, Stanislaus 
##                                      7 
##                        Sharma, Chakshu 
##                                      8 
##                   Shettar, Channabasav 
##                                      3 
##                         Shih, Warren W 
##                                     11 
##                           Shoman, Nael 
##                                      3 
##                           Shuba, Lesya 
##                                      3 
##                    Silver, M. Margaret 
##                                      2 
##                   Sivakumar, Saraswati 
##                                      3 
##                     Smith, Andrew Neil 
##                                      8 
##                           Smith, Anita 
##                                      4 
##                         Smith, Matthew 
##                                      5 
##                  Smith, Philip Michael 
##                                     13 
##                   Smith, Thomas Duncan 
##                                      3 
##                          Stein, John D 
##                                      5 
##                 Stewart, Keir Marshall 
##                                      6 
##                         Stoddart, Todd 
##                                     12 
##                    Swinkles, Stephanie 
##                                      2 
##                         T'ien, Wallace 
##                                      5 
##                         Tan, Alexander 
##                                      2 
##                          Tang, David T 
##                                      5 
##                     Taylor, Benjamin A 
##                                      5 
##                        Taylor, S. Mark 
##                                      7 
##                         Topp, Trevor J 
##                                      8 
##                   Trenholm, J Andrew I 
##                                      7 
##                     Trites, Jonathan R 
##                                      4 
##                        Tynski, Gregory 
##                                      6 
##             Urquhart, Nathan Alexander 
##                                     10 
##                            Vair, Brett 
##                                      5 
##                     Van eyk, Nancy Ann 
##                                      3 
##                     Wallace, Timothy D 
##                                      8 
##                         Walling, Simon 
##                                      3 
##                          Walsh, Mark J 
##                                     12 
##                   Wasilewski, Leszek J 
##                                     13 
##                       Wasserman, Lukas 
##                                     21 
##                   Watson-Jessome, Jane 
##                                      7 
##                        Weeks, Adrienne 
##                                      2 
##                            Weise, Lutz 
##                                      7 
##                     Wheelock, Margaret 
##                                      8 
##                        Williams, Blair 
##                                     11 
##                      Williams, Jason G 
##                                      6 
##                             Wong, Ivan 
##                                      4 
##                         Wood, Jeremy R 
##                                      5 
##                            Yaffe, Paul 
##                                     10 
##                         Yepes, Horacio 
##                                      4 
##                            Zaki, Amr M 
##                                      2
counts <- table(wait_times$Provider)
barplot(counts, main="Wait Times", xlab="Provider")

In the table and bar graph above, Wasserman, Lukas had the highest wait time, and there were several providers who had the lowest wait times.

print("Zone")
## [1] "Zone"
table(wait_times$Zone)
## 
##           IWK  Total Zone 1 Zone 2 Zone 3 Zone 4 
##   1817    241   1322    799    469    742   1317
counts <- table(wait_times$Zone)
barplot(counts, main="Wait Times", xlab="Zone")

In the table and bar graph above, IWK had the lowest wait time, while Zone 4 had the highest wait time by far.

print("Facility")
## [1] "Facility"
table(wait_times$Facility)
## 
##                                                       Aberdeen Hospital 
##                                1817                                 159 
##                Cape Breton Regional Colchester East Hants Health Centre 
##                                 327                                 216 
##                 Cumberland Regional                   Dartmouth General 
##                                  94                                 312 
##                           Glace Bay            Hants Community Hospital 
##                                  21                                  42 
##     Inverness Consolidated Memorial                                 IWK 
##                                  36                                 241 
##                       New Waterford                   Northside General 
##                                  65                                 108 
##                          Provincial                                 QE2 
##                                1322                                 963 
##                   Soldiers Memorial                South Shore Regional 
##                                  10                                 233 
##                St. Marthas Regional                     Valley Regional 
##                                 185                                 397 
##                   Yarmouth Regional 
##                                 159
counts <- table(wait_times$Facility)
barplot(counts, main="Wait Times", xlab="Facility")

In the table and bar graph above, Soldiers Memorial had the lowest wait time at 10, while QE2 had the highest at 971. This may be secondary to the fact that Soldiers Memorial is a rural community hospital which mainly performs simple procedures, and all the complex procedures in the province are performed at the QE2.

print("Consult Median")
## [1] "Consult Median"
table(wait_times$Consult_Median)
## 
##    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15 
##    8    3   12   26   13   35   81   70   45   58   64   70   90  166   69 
##   16   17   18   19   20   21   22   23   24   25   26   27   28   29   30 
##   91   73   92   74  125  127  106  104   64   63   64   85  104   92   78 
##   31   32   33   34   35   36   37   38   39   40   41   42   43   44   45 
##   66   60   56   82  102   64   53   39   58   48   71   68   81   57   43 
##   46   47   48   49   50   51   52   53   54   55   56   57   58   59   60 
##   38   37   47   50   56   45   42   50   55   41   61   28   39   44   35 
##   61   62   63   64   65   66   67   68   69   70   71   72   73   74   75 
##   33   43   49   35   30   28   11   36   37   43   18   20   15   25   25 
##   76   77   78   79   80   81   82   83   84   85   86   87   88   89   90 
##   30   24   45   13   24   26   19   26   27   22   26   17   21   19   18 
##   91   92   93   94   95   96   97   98   99  100  101  102  103  104  105 
##   31   22   33   19   14   13   28   24   19   14    9   21   11   15   18 
##  106  107  108  109  110  111  112  113  114  115  116  117  118  119  120 
##   13   17   10   16    7   14   21   13   13   14   23   14   17   16   14 
##  121  122  123  124  125  126  127  128  129  130  131  132  133  134  135 
##   10   11   10    8   13   18   11    9    8    6   11    6   10    8    7 
##  136  137  138  139  140  141  142  143  144  145  146  147  148  149  150 
##    8    5    6   11    7    5    4    7    2    2    9    7    1    6    8 
##  151  152  153  154  155  156  157  158  159  160  161  162  163  164  165 
##    5    5    7   11    9    6    5    4    7    6    8    2    3    6    7 
##  166  167  168  169  170  171  172  173  174  175  176  177  178  179  180 
##    9    5    4    8    3    5    5    4    4    6    2    2    3    4    2 
##  181  182  183  184  185  186  187  188  189  190  191  192  193  194  195 
##    5    5    4    4    4    2    1    6    2    2    2    2    1    1    5 
##  196  197  198  199  200  201  202  203  204  205  206  207  208  209  210 
##    2    1    3    6    1    2    2    4    2    6    2    1    2    2    2 
##  211  212  213  214  216  217  219  220  221  222  223  224  225  228  233 
##    2    2    3    2    1    2    3    4    5    1    1    1    2    1    1 
##  234  235  236  237  239  241  246  247  249  251  252  254  255  259  261 
##    1    2    3    3    3    1    2    2    2    2    1    1    2    6    2 
##  269  270  272  273  274  276  277  280  281  283  284  285  287  288  290 
##    1    3    1    1    1    2    3    2    1    1    1    2    1    2    1 
##  291  296  298  300  307  308  311  313  314  316  320  322  326  330  336 
##    1    1    2    1    1    1    1    1    3    1    1    1    1    1    2 
##  337  340  345  354  356  361  362  365  367  368  371  375  378  389  395 
##    2    2    1    1    1    1    1    1    2    1    2    1    2    1    1 
##  398  399  400  406  425  427  435  438  440  461  469  476  487  497  506 
##    2    1    1    1    1    1    1    1    1    1    2    1    1    1    1 
##  525  530  539  549  566  574  612  685  764  821  922  963  982 1124 1217 
##    2    1    1    1    2    1    1    1    2    1    1    1    2    1    1 
## 1245 1289 1720 2032 
##    1    1    2    1
counts <- table(wait_times$Consult_Median)
barplot(counts, main="Wait Times", xlab="Consult Median")

The above histogram resembles an exponential distribution, which is in line with queues and wait times.

print("Consult 90th")
## [1] "Consult 90th"
table(wait_times$Consult_90th)
## 
##    1    2    3    4    5    7    8    9   10   11   12   13   14   15   16 
##    5    1    1   13    3    6    6    7    9    8    6    9   14   17   12 
##   17   18   19   20   21   22   23   24   25   26   27   28   29   30   31 
##    8   10   20   37   31   23   26   12   15   34   28   37   41   26   25 
##   32   33   34   35   36   37   38   39   40   41   42   43   44   45   46 
##   25   23   36   42   27   25   22   25   24   39   53   45   31   13   19 
##   47   48   49   50   51   52   53   54   55   56   57   58   59   60   61 
##   22   28   53   41   19   20   34   25   43   64   23   24   23   27   23 
##   62   63   64   65   66   67   68   69   70   71   72   73   74   75   76 
##   32   42   31   24   20   28   19   35   36   29   23   12   23   23   33 
##   77   78   79   80   81   82   83   84   85   86   87   88   89   90   91 
##   26   24   15   18   17   23   19   31   30   20   19   19   24   40   51 
##   92   93   94   95   96   97   98   99  100  101  102  103  104  105  106 
##   24   17   12   16   17   31   28   19   15   14   17   24   11   36   15 
##  107  108  109  110  111  112  113  114  115  116  117  118  119  120  121 
##   21   17   18   13   17   24   33    8   12   19   16   26   27   25   12 
##  122  123  124  125  126  127  128  129  130  131  132  133  134  135  136 
##    9   13   15   22   24   15   19   20   14   16   21   27   32   16   15 
##  137  138  139  140  141  142  143  144  145  146  147  148  149  150  151 
##   13   12   12   23   16   16   16   14   11   28   21   11   12    8   11 
##  152  153  154  155  156  157  158  159  160  161  162  163  164  165  166 
##   20   18   23   18   14   13   16   11   17   31   11    8    7   12   17 
##  167  168  169  170  171  172  173  174  175  176  177  178  179  180  181 
##   16   16   11   26   11   10   15   22   24   18   11   11   15   15   21 
##  182  183  184  185  186  187  188  189  190  191  192  193  194  195  196 
##   27   13   16    9   13   17   12   17   10   24   16   11   11   14   23 
##  197  198  199  200  201  202  203  204  205  206  207  208  209  210  211 
##   20   14   14   12    7    8   13   13    7   14   12   14   14   11   17 
##  212  213  214  215  216  217  218  219  220  221  222  223  224  225  226 
##    9   17   15   16   17   13   14   11    3    5   10   12   12   12    8 
##  227  228  229  230  231  232  233  234  235  236  237  238  239  240  241 
##   10   17   11   11    5    9   10    5    9    6   12   16    9    8    6 
##  242  243  244  245  246  247  248  249  250  251  252  253  254  255  256 
##    7   10   12   11    8    7    7    4   10    4    5    5    7    6    2 
##  257  258  259  260  261  262  263  264  265  266  267  268  269  270  271 
##    6    9   15    7    4    4   11    4    6    7   11   13    5    6    2 
##  272  273  274  275  276  277  278  279  280  281  282  284  285  286  287 
##    5    9    9    6    2    5    9    8   14    5    8    3    5    2    6 
##  288  290  291  292  293  294  295  296  297  298  299  300  301  302  303 
##    9    1    8    3   10    6    5    7    1    6    5    5    8    3    4 
##  304  305  306  307  308  309  310  311  312  313  314  315  316  317  318 
##    4    5    2    2   10    1    2    3    3    3    3    7    4    4    5 
##  319  320  321  322  324  325  326  327  328  329  330  331  332  333  334 
##    2    7    3    6   12    1    7    3    2   10   15    2    6    6    4 
##  335  336  337  338  339  340  341  342  343  344  345  346  347  348  349 
##    4    9   12    2    5    3    1    3    6    1    4    2    2    4    2 
##  350  351  352  356  357  358  359  360  361  363  364  365  366  367  368 
##    8    6    4    6    4    3    2    2    2    5   10    7    1    3    2 
##  369  370  371  372  373  374  375  376  377  378  379  380  381  382  383 
##    1    1    2    8    9    4    4    1    3    6    4    5    1    5    3 
##  384  385  386  387  388  389  390  391  392  393  394  395  396  398  399 
##    1    1    5    2    6    3    4    2    6    4    3    3    7    4    2 
##  400  402  404  405  406  407  408  410  411  412  413  414  415  416  417 
##    3    4    3    7    4    4    3    2    3    2    2    2    1    6    1 
##  418  419  421  422  423  424  426  427  428  429  430  431  432  434  435 
##    1    1    1    1    2    3    4    8    2    3    1    3    9    1    1 
##  436  437  439  440  442  443  445  446  447  448  449  453  454  455  456 
##    3    7    1    6    3    3    5    1    3    2    3    1    6    4    1 
##  458  459  460  461  462  463  464  465  466  468  469  470  471  474  475 
##    2    2    2    5    1    5    1    1    1    6    2    1    6    3    4 
##  476  477  478  479  481  482  483  485  487  488  490  491  492  493  495 
##    1    2    1    2    1    1    3    2    1    1    3    3    5    2    2 
##  496  497  498  499  501  502  504  506  507  508  511  512  513  514  515 
##    1    3    3    1    2    1    4    2    1    1    1    1    2    1    1 
##  517  518  523  529  530  531  534  536  537  538  542  544  545  546  547 
##    1    1    1    1    4    4    1    1    1    1    1    1    1    4    3 
##  549  552  554  557  558  560  562  565  566  568  574  575  576  578  581 
##    1    1    1    1    2    1    1    3    1    1    2    3    2    2    1 
##  585  590  591  594  600  601  603  604  605  609  612  617  619  620  627 
##    1    1    1    1    2    1    1    1    2    1    1    2    1    3    2 
##  637  638  644  645  650  655  656  661  664  681  682  683  685  686  704 
##    2    2    1    1    3    3    1    1    1    1    3    1    1    2    1 
##  706  710  713  716  722  728  729  735  736  737  750  755  757  758  762 
##    1    3    1    1    1    2    3    1    4    4    4    1    3    1    1 
##  763  766  783  784  789  790  793  797  811  828  839  840  847  856  870 
##    2    1    1    1    1    1    1    1    2    2    1    1    1    1    1 
##  877  881  884  916  917  946  951  953  960  998 1000 1002 1050 1051 1052 
##    1    1    2    1    2    1    1    2    1    1    1    1    2    2    1 
## 1055 1090 1104 1125 1134 1148 1150 1177 1182 1200 1230 1248 1262 1289 1296 
##    2    1    3    2    4    1    1    2    1    1    1    1    1    1    1 
## 1322 1357 1381 1403 1442 1449 1506 1558 1829 2032 2033 2071 2162 2310 2474 
##    1    2    1    2    1    3    1    1    2    1    2    3    1    1    2 
## 2490 2544 2599 3047 3187 3282 
##    2    2    1    5    2    2
counts <- table(wait_times$Consult_90th)
barplot(counts, main="Wait Times", xlab="Consult 90th")

The above histogram resembles an exponential distribution, which is in line with queues and wait times.

print("Surgery Median")
## [1] "Surgery Median"
table(wait_times$Surgery_Median)
## 
##    0    2    3    4    5    6    7    8    9   10   11   12   13   14   15 
##    1    6   18    5    9   16   15   24   31   18   21   37   52   43   77 
##   16   17   18   19   20   21   22   23   24   25   26   27   28   29   30 
##   62   54   72   60   73   88   87   90   69   67   83  104   86  103   79 
##   31   32   33   34   35   36   37   38   39   40   41   42   43   44   45 
##   69   79  105  111   77  103   98   87   77   84   87   78   89   66   56 
##   46   47   48   49   50   51   52   53   54   55   56   57   58   59   60 
##   59   76   92   78   62   59   53   64   53   65   60   61   62   34   46 
##   61   62   63   64   65   66   67   68   69   70   71   72   73   74   75 
##   57   56   34   62   43   45   39   30   57   29   43   40   41   35   35 
##   76   77   78   79   80   81   82   83   84   85   86   87   88   89   90 
##   47   42   46   37   28   37   20   47   51   33   26   23   15   35   30 
##   91   92   93   94   95   96   97   98   99  100  101  102  103  104  105 
##   29   25   30   22   30   15   23   30   27   25   22   20   18   21   16 
##  106  107  108  109  110  111  112  113  114  115  116  117  118  119  120 
##   30   16   12   24   18   21   14   22   17   20    6   14   20   13   17 
##  121  122  123  124  125  126  127  128  129  130  131  132  133  134  135 
##   17   18   14   15   25   14   25   12    8    8   17   19   17   11   19 
##  136  137  138  139  140  141  142  143  144  145  146  147  148  149  150 
##    8    4   10   13    8    7    7   10   10    4   11    8   10   11   17 
##  151  152  153  154  155  156  157  158  159  160  161  162  163  164  165 
##    3    6   11    7    6    5    6   13    3    8    7    9    5    7    5 
##  166  167  168  169  170  171  172  173  174  175  176  177  178  179  180 
##    3    7    8    5    5   12    5    2    8    4   13    7    4    5    4 
##  181  182  183  184  185  186  187  188  189  190  191  192  193  194  195 
##    6   10    7    7    4    2    6    7    3    4    2    4    5    4    6 
##  196  197  198  199  200  201  202  203  204  205  206  207  208  209  210 
##    8   13    2    7    3    2    8    7    4    5    1    3    3   10    6 
##  211  212  213  214  215  216  217  218  219  220  221  222  223  224  225 
##    5    4    4    4    4    3    2    4    3    4    2    3    6    3    6 
##  226  227  228  229  230  231  232  233  234  235  236  237  238  239  240 
##    1    2    4    2    3    2    3    4    1    1    4    2    3    3    4 
##  241  242  243  245  247  248  249  251  252  253  254  255  256  257  258 
##    3    2    4    5    1    2    1    2    2    4    3    3    1    4    3 
##  260  262  263  264  265  266  267  268  269  270  271  273  274  275  276 
##    2    3    5    1    2    1    1    2    2    1    2    5    1    6    2 
##  277  279  280  281  282  283  284  285  287  288  292  293  295  296  297 
##    1    2    2    2    1    3    5    1    2    2    2    1    2    1    1 
##  300  301  302  304  305  307  309  310  311  313  314  315  316  318  319 
##    1    4    2    1    1    2    2    1    2    2    1    1    3    1    1 
##  320  322  323  324  327  329  330  332  334  336  337  338  343  344  345 
##    3    1    2    2    1    2    1    1    1    1    1    1    3    1    1 
##  348  349  351  353  354  358  360  363  366  369  370  373  374  389  390 
##    1    1    1    1    1    2    1    1    1    1    1    2    2    1    1 
##  393  403  405  407  408  412  413  423  430  433  436  437  446  456  462 
##    1    3    1    1    1    1    1    1    1    1    1    1    1    1    1 
##  467  471  472  475  479  484  491  492  498  500  506  510  513  558  560 
##    1    2    2    1    1    1    1    1    1    2    1    1    1    1    1 
##  561  567  571  600  608  680  730  739 1167 
##    1    1    1    1    1    1    1    1    1
counts <- table(wait_times$Surgery_Median)
barplot(counts, main="Wait Times", xlab="Surgery Median")

The above histogram resembles an exponential distribution, which is in line with queues and wait times.

print("Surgery 90th")
## [1] "Surgery 90th"
table(wait_times$Surgery_90th)
## 
##    4    5    6    8    9   10   11   12   13   14   15   16   17   18   19 
##    4    3    2    6    4    2    2    3    2    4    8    4    2    5    3 
##   20   21   22   23   24   25   26   27   28   29   30   31   32   33   34 
##   17   16   19   25    5   15   14   26   23   22   26   10   17   17   31 
##   35   36   37   38   39   40   41   42   43   44   45   46   47   48   49 
##   27   32   23   22   11   19   35   23   36   20   23   22   26   29   41 
##   50   51   52   53   54   55   56   57   58   59   60   61   62   63   64 
##   36   16   24   20   24   32   24   41   27   18   16   22   43   28   49 
##   65   66   67   68   69   70   71   72   73   74   75   76   77   78   79 
##   27   21   32   41   31   39   46   32   37   23   35   51   30   34   25 
##   80   81   82   83   84   85   86   87   88   89   90   91   92   93   94 
##   28   23   29   39   37   34   31   14   16   32   39   34   30   35   32 
##   95   96   97   98   99  100  101  102  103  104  105  106  107  108  109 
##   28   28   34   33   41   36   23   16   25   42   43   47   32   22   17 
##  110  111  112  113  114  115  116  117  118  119  120  121  122  123  124 
##   24   47   22   27   22   21   24   39   26   25   37   24   16   19   28 
##  125  126  127  128  129  130  131  132  133  134  135  136  137  138  139 
##   28   24   46   16    9   13   28   30   28   36   28   13   32   18   19 
##  140  141  142  143  144  145  146  147  148  149  150  151  152  153  154 
##   13   28   30   14   18   27   39   25   34   25   18   23   19   16   16 
##  155  156  157  158  159  160  161  162  163  164  165  166  167  168  169 
##   25   24   19   21   19   18   22   24   12   15   10   13   31   16   18 
##  170  171  172  173  174  175  176  177  178  179  180  181  182  183  184 
##   30   18   17   19   22   19   22   22   15   10   16   23   17   30   21 
##  185  186  187  188  189  190  191  192  193  194  195  196  197  198  199 
##   22   16    8   17   18   18    8   18   18    8   17   18   28   15   15 
##  200  201  202  203  204  205  206  207  208  209  210  211  212  213  214 
##    8   12   17   17   27   12   12   16   10   16    9   16    8    8   10 
##  215  216  217  218  219  220  221  222  223  224  225  226  227  228  229 
##   15   21   16   11   18   10    8   17   18   10   12   10   13   17   16 
##  230  231  232  233  234  235  236  237  238  239  240  241  242  243  244 
##   14   10   25   10   16    8    9    8    9    6    8    8    9    5   12 
##  245  246  247  248  249  250  251  252  253  254  255  256  257  258  259 
##    4   10    7    4   10    7   10    6   18    9    8    8   10   13   11 
##  260  261  262  263  264  265  266  267  268  269  270  271  272  273  274 
##    6    8    4    5    4   13    7    5    4    7    7    5   18    9   13 
##  275  276  277  278  279  280  281  282  283  284  285  286  287  288  289 
##    9    4    5    4   12    7   10   11    6    2    4    5    7   11    8 
##  290  291  292  293  294  295  296  297  298  299  300  301  302  303  304 
##    4    7    5    8    2    3    8    3    6    3   14    8   16    5    4 
##  305  306  307  308  309  310  311  312  313  314  315  316  317  318  319 
##    1    3   14    2    9    3    7   13    2    9    2    7    4    7    4 
##  320  321  322  323  324  325  326  327  328  329  330  331  333  334  335 
##    4    5    6    7   15    6    1    6    5    4    8    5    1    1    6 
##  336  337  338  339  342  343  344  345  346  347  348  349  350  351  352 
##    9    6    3    8    7    5    4    7    6    2   10    6    9    5    6 
##  353  354  355  356  357  358  359  360  361  362  363  364  365  366  368 
##    5    3    5    7   11    6    5   11    2    3    5    6    6    7    4 
##  369  370  371  372  373  374  375  376  377  379  380  381  382  383  384 
##    1    6    4   10    3    2    3    6    1    3    9    3    4    1    4 
##  385  386  387  388  389  390  391  392  393  394  395  396  397  398  400 
##    3    5    7    1    2    1    8   11    6    1    1    2    4    4    8 
##  401  402  403  405  406  407  408  409  410  411  412  413  414  415  416 
##    1    5    2    4    1    3    3    3    1    5    4    5    3    3    4 
##  417  419  420  421  422  424  425  426  427  428  429  432  433  435  436 
##    4    5    1   10    4    2    1    7    3    2    7    1    3    1    2 
##  437  438  439  440  441  442  443  444  445  446  447  448  449  450  451 
##    9    3    1    7    1    2    4    2    4    3    1    4    9    5    1 
##  452  454  455  456  457  459  461  462  463  464  465  467  468  469  470 
##    5    2    3    2    3    6    4    1    4    1    3    2    4    1    4 
##  471  472  473  474  475  476  477  479  480  482  483  484  485  486  487 
##    1    6    1    4    1    4    2    5    1    4    2    9    1    1    1 
##  488  489  490  491  492  493  495  496  497  498  499  501  502  503  504 
##    3    3    3    5    2    2    1    1    1    3    4    2    1    2    2 
##  505  506  507  508  509  510  511  512  514  515  517  518  520  521  522 
##    5    2    2    1    5    1    5    3    3    4    2    2    2    4    1 
##  523  524  528  530  531  532  534  535  537  538  540  544  545  546  547 
##    1    3    2    2    2    1    2    1    1    2    1    2    1    1    2 
##  548  549  551  553  554  555  556  557  559  560  561  564  565  566  567 
##    2    3    1    1    4    2    1    2    2    1    3    2    4    3    1 
##  569  577  578  581  583  587  588  589  590  592  593  594  595  596  597 
##    1    1    1    2    1    2    1    2    2    1    2    2    1    1    3 
##  602  603  606  608  609  610  611  616  618  622  623  625  627  629  631 
##    2    2    1    1    1    3    1    1    2    2    1    1    1    1    2 
##  635  638  640  644  645  647  653  655  662  664  668  672  673  675  676 
##    1    5    3    1    1    1    1    1    1    1    2    1    1    3    1 
##  687  691  692  694  698  699  700  701  704  706  710  711  713  715  718 
##    3    1    1    2    1    4    1    1    1    1    1    1    1    2    1 
##  719  720  723  729  731  732  740  741  745  746  750  751  753  755  757 
##    1    1    1    1    1    1    1    1    1    1    1    1    2    1    1 
##  759  764  766  767  773  776  782  789  791  799  800  802  810  811  818 
##    1    1    1    1    1    1    1    1    3    1    2    1    1    1    1 
##  827  829  835  848  852  853  871  877  882  890  891  907  922  925  926 
##    1    1    1    1    1    1    1    1    1    2    1    1    1    1    1 
##  928  930  933  939  951  958  967  983  995 1027 1057 1058 1063 1107 1126 
##    1    1    2    1    1    1    1    3    1    1    1    1    1    1    1 
## 1136 1139 1152 1170 1181 1182 1240 1260 1294 1483 1525 1843 1891 1940 2025 
##    2    1    1    1    1    1    2    1    1    1    1    1    2    1    1
counts <- table(wait_times$Surgery_90th)
barplot(counts, main="Wait Times", xlab="Surgery 90th")

The above histogram resembles an exponential distribution, which is in line with queues and wait times.

Before we do boxplots of the overall surgery and consult wait times, let’s review what a box plot tells us.

The top and bottom lines of the rectangle are the 3rd and 1st quartiles (Q3 and Q1), respectively. The length of the rectangle from top to bottom is the interquartile range (IQR). The line in the middle of the rectangle is the median (or the 2nd quartile, Q2). The top whisker denotes the maximum value or the 3rd quartile plus 1.5 times the interquartile range (Q3 + 1.5IQR), whichever is smaller. The bottom whisker denotes either the minimum value or the 1st quartile minus 1.5 times the interquartile range (Q1 – 1.5IQR), whichever is larger. (Referenced from https://chemicalstatistician.wordpress.com/2013/05/26/exploratory-data-analysis-variations-of-box-plots-in-r-for-ozone-concentrations-in-new-york-city-and-ozonopolis/)

Now let’s do boxplots of the surgery and consult wait times:

summary(wait_times$Surgery_90th)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##     4.0    79.0   137.0   182.4   229.0  2025.0     149
# abstract the raw data vector
surgery_wait_90 <- wait_times$Surgery_90th
# remove the missing values
surgery_wait_90 <- surgery_wait_90[!is.na(surgery_wait_90)]
#it appears that R removes the missing values when calculating summary statistics
summary(surgery_wait_90)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     4.0    79.0   137.0   182.4   229.0  2025.0
boxplot(surgery_wait_90, ylab = 'Wait Times (days)', main = 'Box Plot of Surgical Wait Times (90th percentile)')

summary(wait_times$Surgery_Median)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    0.00   32.00   52.00   73.88   91.00 1167.00     149
# abstract the raw data vector
surgery_wait_50 <- wait_times$Surgery_Median
# remove the missing values
surgery_wait_50 <- surgery_wait_50[!is.na(surgery_wait_50)] 
boxplot(surgery_wait_50, ylab = 'Wait Times (days)', main = 'Box Plot of Surgical Wait Times (Median)')

# abstract the raw data vector
summary(wait_times$Consult_90th)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##     1.0    62.0   127.0   182.1   220.2  3282.0     979
consult_wait_90 <- wait_times$Consult_90th
# remove the missing values
consult_wait_90 <- consult_wait_90[!is.na(consult_wait_90)] 
boxplot(consult_wait_90, ylab = 'Wait Times (days)', main = 'Box Plot of Consult Wait Times (90th percentile)')

summary(wait_times$Consult_Median)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    1.00   22.00   42.00   62.98   78.00 2032.00     979
# abstract the raw data vector
consult_wait_50 <- wait_times$Consult_Median
# remove the missing values
consult_wait_50 <- consult_wait_50[!is.na(consult_wait_50)] 
boxplot(consult_wait_50, ylab = 'Wait Times (days)', main = 'Box Plot of Consult Wait Times (Median)')

When looking at the box plots for overall wait times, you have to combine the wait time to get a consult with the surgeon after seeing your family doctor, and then add it to the wait time for which you actually receive your procedure (surgery). If you want to get the wait times for most people, then you go with the 90th percentile wait times for consult and surgery. However, it is not as simple as adding these two variables, as the variance will be much bigger when both are added together. This will be important when exploratory analysis is finished and modeling begins.

str(wait_times)
## 'data.frame':    6707 obs. of  12 variables:
##  $ Period        : Factor w/ 11 levels "12month_rolling",..: 3 4 2 2 6 2 7 5 4 2 ...
##  $ Specialty     : Factor w/ 17 levels "","All Specialties",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Procedure     : Factor w/ 159 levels "","Adrenal Surgery",..: 93 42 124 79 104 84 131 69 42 47 ...
##  $ Provider      : Factor w/ 297 levels "","Abdul Kadir, Najeeb Ahmed",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Zone          : Factor w/ 7 levels "","IWK","Total",..: 6 6 3 7 7 7 3 7 6 7 ...
##  $ Facility      : Factor w/ 19 levels "","Aberdeen Hospital",..: 3 9 13 6 6 6 13 14 12 14 ...
##  $ Year          : int  2016 2017 2016 2016 2017 2016 2017 2017 2017 2016 ...
##  $ Quarter       : int  4 1 3 3 3 3 4 2 1 3 ...
##  $ Consult_Median: int  21 25 121 68 35 28 70 58 23 31 ...
##  $ Consult_90th  : int  52 52 228 173 65 60 578 105 175 77 ...
##  $ Surgery_Median: int  39 26 69 61 104 30 98 65 30 23 ...
##  $ Surgery_90th  : int  67 64 160 221 324 59 150 135 135 90 ...

Above, this gives information on the dataframe and its variables.

plot(wait_times)

Above is a plot of all the variables in the dataframe, against each other.

The modeling we do next is to incorporate the queue for the consult wait times which feeds into the queue for the surgery wait times, and take into account the exponential distributions of these consult and surgery wait times.