This report explores the universe of patient visits to Empirical Emergency Department, following the instructions detailed in the empirical exercise.
Here, I summarize the given data.
## [1] "This data follows 43 doctors in Empirical Emergency Department. from the first shift's start at 1982-05-15 13:00:00 to the last shift's end at 1982-07-16 04:00:00"
The number of shifts per doctor is outlined below:
The summary statistics for the number of patients in each shift for each doctor are outlined below.
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.00 14.00 17.00 16.66 19.00 30.00
The summary statistics for physician shift length in hours are outlined below.
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2.000 9.000 9.000 9.103 9.000 10.000
## [1] "This data logs 8831 patient visits from the first arrival at 1982-05-15 20:07:00 to the last departure at 1982-07-16 10:17:00"
The summary statistics of patient stay duration in minutes are outlined below. It appears that there are some patients with negative-time stays (time travelers?), which must be coded incorrectly. We will have to drop this when doing any analysis.
The second summary is created after dropping these time travelers.
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## -109.0 103.0 171.0 242.5 276.0 2211.0
## patient_duration
## Min. : 3.0
## 1st Qu.: 103.0
## Median : 171.0
## Mean : 242.6
## 3rd Qu.: 276.0
## Max. :2211.0
## [1] "About 7.36% of patients arrive before the start of their physician's shift, and about 18.967% of patients stay after the official end of their physician's shift."
Describe hourly patterns of patient arrivals and the average severity of these patients.
Below is the distribution of patients arrivals by hour:
Here is a plot of the average patient severity by hour. In order to test this relationship causally, we would need to regress patient severity on the hour of arrival and include controls of those characteristics that feed into patient severity like age, income, etc.
Here is a peak at what the census looks like:
Below are the regression results without and including the controls identified above. It appears that Woodrow discharges patients the fastest because the estimated coefficient for the dummy variable indicating Woodrow as the attending physician is the “most negative”, meaning that Woodrow’s attendance takes off the largest amount of time to discharge as compared with the base doctor.
| Dependent variable: | ||
| log(patient_duration) | ||
| (1) | (2) | |
| factor(phys_name)Andrew | -0.183** | -0.104 |
| (0.081) | (0.073) | |
| factor(phys_name)Anne | -0.081 | -0.033 |
| (0.085) | (0.077) | |
| factor(phys_name)Audrey | -0.171** | -0.154** |
| (0.078) | (0.070) | |
| factor(phys_name)Barack | -0.462*** | -0.398*** |
| (0.079) | (0.071) | |
| factor(phys_name)Beatrix | -0.245*** | -0.189*** |
| (0.071) | (0.065) | |
| factor(phys_name)Benazir | -0.110 | -0.038 |
| (0.084) | (0.076) | |
| factor(phys_name)Benjamin | -0.141* | -0.120* |
| (0.077) | (0.069) | |
| factor(phys_name)Bill | -0.226*** | -0.200*** |
| (0.080) | (0.072) | |
| factor(phys_name)Calvin | -0.043 | -0.033 |
| (0.076) | (0.068) | |
| factor(phys_name)Chester | -0.150 | -0.122 |
| (0.098) | (0.089) | |
| factor(phys_name)Diana | -0.505*** | -0.432*** |
| (0.076) | (0.068) | |
| factor(phys_name)Dwight | -0.161** | -0.083 |
| (0.074) | (0.067) | |
| factor(phys_name)Eleanor | -0.104 | -0.158* |
| (0.097) | (0.087) | |
| factor(phys_name)Elizabeth | -0.197* | -0.111 |
| (0.105) | (0.095) | |
| factor(phys_name)Franklin | -0.206** | -0.181** |
| (0.084) | (0.076) | |
| factor(phys_name)George | 0.091 | 0.069 |
| (0.085) | (0.077) | |
| factor(phys_name)Gerald | -0.109 | -0.065 |
| (0.073) | (0.066) | |
| factor(phys_name)Grover | -0.221*** | -0.180** |
| (0.085) | (0.077) | |
| factor(phys_name)Harry | -0.036 | -0.026 |
| (0.074) | (0.067) | |
| factor(phys_name)Herbert | -0.425*** | -0.386*** |
| (0.089) | (0.081) | |
| factor(phys_name)Hillary | -0.112 | -0.138* |
| (0.085) | (0.077) | |
| factor(phys_name)Ingrid | -0.292*** | -0.247*** |
| (0.075) | (0.068) | |
| factor(phys_name)Jacqueline | -0.245*** | -0.277*** |
| (0.094) | (0.085) | |
| factor(phys_name)James | -0.127 | -0.076 |
| (0.090) | (0.081) | |
| factor(phys_name)Jimmy | -0.016 | -0.033 |
| (0.084) | (0.076) | |
| factor(phys_name)John | 0.025 | 0.042 |
| (0.082) | (0.074) | |
| factor(phys_name)Kate | -0.169** | -0.140* |
| (0.086) | (0.078) | |
| factor(phys_name)Katharine | 0.094 | 0.041 |
| (0.118) | (0.108) | |
| factor(phys_name)Lyndon | -0.050 | -0.010 |
| (0.083) | (0.075) | |
| factor(phys_name)Martin | -0.385*** | -0.359*** |
| (0.076) | (0.069) | |
| factor(phys_name)Oprah | 0.004 | 0.038 |
| (0.083) | (0.075) | |
| factor(phys_name)Richard | -0.172* | -0.177** |
| (0.094) | (0.085) | |
| factor(phys_name)Ronald | -0.438*** | -0.376*** |
| (0.088) | (0.080) | |
| factor(phys_name)Teresa | -0.459*** | -0.362*** |
| (0.093) | (0.084) | |
| factor(phys_name)Thomas | 0.119 | 0.136 |
| (0.179) | (0.163) | |
| factor(phys_name)Ulysses | 0.068 | 0.034 |
| (0.090) | (0.082) | |
| factor(phys_name)Victoria | -0.311 | -0.406 |
| (0.588) | (0.533) | |
| factor(phys_name)Virginia | -0.140* | -0.106 |
| (0.077) | (0.070) | |
| factor(phys_name)Warren | -0.264*** | -0.231*** |
| (0.076) | (0.069) | |
| factor(phys_name)Whoopi | -0.319*** | -0.282*** |
| (0.071) | (0.064) | |
| factor(phys_name)William | -0.155* | -0.111 |
| (0.088) | (0.080) | |
| factor(phys_name)Woodrow | -0.475*** | -0.457*** |
| (0.086) | (0.078) | |
| patients_in_shift | -0.001 | |
| (0.002) | ||
| factor(patient_arrival_hour)1 | 0.112 | |
| (0.096) | ||
| factor(patient_arrival_hour)2 | 0.155* | |
| (0.091) | ||
| factor(patient_arrival_hour)3 | 0.115 | |
| (0.090) | ||
| factor(patient_arrival_hour)4 | -0.038 | |
| (0.077) | ||
| factor(patient_arrival_hour)5 | 0.094 | |
| (0.076) | ||
| factor(patient_arrival_hour)6 | 0.134* | |
| (0.072) | ||
| factor(patient_arrival_hour)7 | 0.159** | |
| (0.072) | ||
| factor(patient_arrival_hour)8 | 0.109 | |
| (0.072) | ||
| factor(patient_arrival_hour)9 | 0.043 | |
| (0.074) | ||
| factor(patient_arrival_hour)10 | 0.133* | |
| (0.073) | ||
| factor(patient_arrival_hour)11 | 0.116 | |
| (0.074) | ||
| factor(patient_arrival_hour)12 | 0.081 | |
| (0.073) | ||
| factor(patient_arrival_hour)13 | 0.040 | |
| (0.073) | ||
| factor(patient_arrival_hour)14 | 0.092 | |
| (0.074) | ||
| factor(patient_arrival_hour)15 | -0.004 | |
| (0.075) | ||
| factor(patient_arrival_hour)16 | 0.062 | |
| (0.074) | ||
| factor(patient_arrival_hour)17 | 0.036 | |
| (0.076) | ||
| factor(patient_arrival_hour)18 | -0.006 | |
| (0.079) | ||
| factor(patient_arrival_hour)19 | 0.017 | |
| (0.082) | ||
| factor(patient_arrival_hour)20 | 0.081 | |
| (0.088) | ||
| factor(patient_arrival_hour)21 | 0.201** | |
| (0.088) | ||
| factor(patient_arrival_hour)22 | 0.134 | |
| (0.091) | ||
| factor(patient_arrival_hour)23 | 0.093 | |
| (0.089) | ||
| xb_lntdc | 0.932*** | |
| (0.021) | ||
| Constant | 5.321*** | 4.184*** |
| (0.058) | (0.098) | |
| Observations | 8,827 | 8,827 |
| R2 | 0.033 | 0.216 |
| Adjusted R2 | 0.028 | 0.210 |
| Residual Std. Error | 0.828 (df = 8784) | 0.746 (df = 8759) |
| F Statistic | 7.091*** (df = 42; 8784) | 36.107*** (df = 67; 8759) |
| Note: | p<0.1; p<0.05; p<0.01 | |