Skip to content

Commit 7801d09

Browse files
committed
Removed Fig 4
1 parent 2afa8e6 commit 7801d09

File tree

6 files changed

+285
-313
lines changed

6 files changed

+285
-313
lines changed

content/blog/2021-03-10_c2b.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ If we assume independence between patients, the mean and variance calculations a
187187

188188
## The only constant during the pandemic is change
189189

190-
By November, we had a prototype Cases2Beds spreadsheet for ACHD that they used. Over the following months, we made various modifications with their feedback. For example, the ACHD staff did not have time to input the case numbers. So, we were able to use the granular public data to give them estimates of future hospital utilization without any inputs on their end. We were also able to showcase the spreadsheet to other health departments and hospitals by generating public parameters for offset and length of stay from different national public resources, like the Florida line-level COVID dataset<sup>[4](#FloridaLineLevelLink)</sup>. Based on these users' feedback, we started to use Cases2Beds as an input to hospital utilization forecasting models. Other inputs included current hospital bed utilization (from HHS Protect<sup>[5](#HHSLink)</sup>), how long current patients are likely to continue to be hospitalized, and how many new cases there will be in the near future. A preliminary evaluation of such a method shows decent predictive power when parameters are *tailored to a location*.
190+
By November, we had a prototype Cases2Beds spreadsheet for ACHD that they used. Over the following months, we made various modifications with their feedback. For example, the ACHD staff did not have time to input the case numbers. So, we were able to use the granular public data to give them estimates of future hospital utilization without any inputs on their end. We were also able to showcase the spreadsheet to other health departments and hospitals by generating public parameters for offset and length of stay from different national public resources, like the Florida line-level COVID dataset<sup>[4](#FloridaLineLevelLink)</sup>. Based on these users' feedback, we started to use Cases2Beds as an input to hospital utilization forecasting models. Other inputs included current hospital bed utilization (from HHS Protect<sup>[5](#HHSLink)</sup>), how long current patients are likely to continue to be hospitalized, and how many new cases there will be in the near future. A preliminary evaluation of such a method shows decent predictive power when parameters are *tailored to a location*.
191191

192192
At the peak of bed utilization, hospital systems themselves increased their COVID beds utilization to *6x* more than in October 2020. Fortunately, in Allegheny County, we never reached a point where demand for beds exceeded a somewhat elastic supply. By early January, multiple organizations told us that the pandemic's most acute problem had changed to vaccine distribution and the number of COVID-19 beds needed dropped. Cases2Beds continues to act as an early warning system if the number of cases rise quickly, but hopefully the worst is now over.
193193

content/blog/2021-03-10_c2b.html

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@
7777
full_df$collection_date &lt;- as.Date(full_df$collection_date, &quot;%m/%d/%y&quot;)
7878
df2 &lt;- data.frame(Key=rep(c(&quot;Hospitalization&quot;, &quot;Positive Cases&quot;), each=nrow(full_df)),
7979
CollectionDate=rep(c(full_df$collection_date),2),
80-
Counts=c(full_df$hospital_flag, full_df$test_result))
80+
Counts=c(full_df$hospital_flag*7, full_df$test_result*7))
8181
ggplot(data=df2, aes(x=CollectionDate, y=Counts, fill=Key), show.legend = FALSE) +
8282
geom_bar(stat=&quot;identity&quot;) +
8383
labs(x = &quot;&quot;, y=&quot;&quot;,
8484
title = &quot;New COVID-19 Hospitalizations and Cases in Allegheny County&quot;,
85-
subtitle = &quot;Weekly Count Averages&quot;,
85+
subtitle = &quot;Total Weekly Counts&quot;,
8686
caption = &quot;Delphi Group, delphi.cmu.edu\nData from WPRDC&quot;) +
8787
theme_bw() +
8888
guides(color = FALSE) + facet_wrap(.~Key, scales = &quot;free&quot;) + scale_x_date(name=&quot;Specimen Collection Date&quot;, date_breaks=&quot;1 month&quot;, minor_breaks=NULL, date_labels=&quot;%b %Y&quot;)+ theme(legend.position = &quot;none&quot;)</code></pre>
89-
<p><img src="/blog/2021-03-10_c2b_files/figure-html/WPRDC-1.svg" width="672" /></p>
89+
<p><img src="/blog/2021-03-10_c2b_files/figure-html/WPRDC-1.svg" width="864" class="wide-figure" /></p>
9090
<p><strong>Fig. 1:</strong> Hospitalizations Due to COVID-19 and New Cases from Positive PCR Tests in Allegheny County (WPRDC Data <sup><a href="#WPRDCLink">1</a></sup>)</p>
9191
<p>Based on its planning, the ACHD needed at least a weeks’ time to open emergency COVID facilities. If the emergency space wasn’t open and hospital beds ran out, mortality rates could soar. But, if we didn’t need the facility, that decision would have stretched already thin resources. Many of the hospitals in Allegheny County were in contact with each other, but each hospital system only had visibility into its own facilities. We wondered if we could offer a higher-level view for ACHD to assist in its planning.</p>
9292
<div id="actionable-intelligence-during-the-pandemic" class="section level2">
@@ -123,7 +123,7 @@ <h2>A probabilistic approach</h2>
123123
theme_bw() +
124124
guides(color = FALSE) +
125125
scale_x_discrete(guide = guide_axis(n.dodge=2)) +scale_y_continuous(labels = scales::percent) </code></pre>
126-
<p><img src="/blog/2021-03-10_c2b_files/figure-html/rates-1.svg" width="672" />
126+
<p><img src="/blog/2021-03-10_c2b_files/figure-html/rates-1.svg" width="864" class="wide-figure" />
127127
<strong>Fig. 2:</strong> Age Group Comparisons based on the Allegheny County COVID-19 Tableau <sup><a href="#ACHDDashboardLink">3</a></sup></p>
128128
<p>We used public data from Allegheny County about the number of people tested, test positivity rate, and hospitalization rate, broken down by the aforementioned demographic factors.</p>
129129
<p>We also acquired information for two critical parameters: offset and length of stay. Offset is the number of days between the day of testing (called specimen collection date) and the first day of hospitalization. For example, if the test date is around the hospital admit date, the offset would be 0 days (or sometimes -1 or +1 days). Otherwise, if the test date was 5 days before hospitalization, the offset would be 5 days. Notably, the offset can be negative, meaning you may have been tested some days or weeks after being admitted (presumably for an unrelated reason).</p>
@@ -168,42 +168,13 @@ <h2>An alternative to Monte Carlo: the analytical model</h2>
168168
caption = &quot;Delphi Group, delphi.cmu.edu&quot;) +
169169
scale_colour_manual(&quot;&quot;,values=&quot;black&quot;)+
170170
scale_fill_manual(&quot;&quot;,values=c(alpha(&quot;red&quot;, 0.5), alpha(&quot;#FF9999&quot;, 0.5)))+ theme(legend.position=&quot;bottom&quot;)</code></pre>
171-
<p><img src="/blog/2021-03-10_c2b_files/figure-html/C2B-1.svg" width="672" />
171+
<p><img src="/blog/2021-03-10_c2b_files/figure-html/C2B-1.svg" width="864" class="wide-figure" />
172172
<strong>Fig. 3:</strong> Output of Cases2Beds using historical data until January 21st for Allegheny County Using Public Parameters</p>
173173
<p>If we assume independence between patients, the mean and variance calculations are exact. However, our quantile estimates are based on approximating the sum of independent binary variables, which is inaccurate near the tails. So the accuracy of the more extreme quantiles (95%+) depends on the number of cases present, which in practice makes them less trustworthy.</p>
174174
</div>
175175
<div id="the-only-constant-during-the-pandemic-is-change" class="section level2">
176176
<h2>The only constant during the pandemic is change</h2>
177-
<p>By November, we had a prototype Cases2Beds spreadsheet for ACHD that they used. Over the following months, we made various modifications with their feedback. For example, the ACHD staff did not have time to input the case numbers. So, we were able to use the granular public data to give them estimates of future hospital utilization without any inputs on their end. We were also able to showcase the spreadsheet to other health departments and hospitals by generating public parameters for offset and length of stay from different national public resources, like the Florida line-level COVID dataset<sup><a href="#FloridaLineLevelLink">4</a></sup>. Based on these users’ feedback, we started to use Cases2Beds as an input to hospital utilization forecasting models. Other inputs included current hospital bed utilization (from HHS Protect<sup><a href="#HHSLink">5</a></sup>), how long current patients are likely to continue to be hospitalized, and how many new cases there will be in the near future. A preliminary evaluation of such a method shows decent predictive power when parameters are <em>tailored to a location</em>. In Fig 4, we show the hospital utilization prediction with <em>generic parameters</em>.</p>
178-
<pre class="r"><code>full_df &lt;- tibble(read.csv(file=&quot;../../public/blog/2021-03-10_c2b/hosp_util.csv&quot;))
179-
full_df$Train_dates &lt;- as.Date(full_df$Train_dates, &quot;%m/%d/%y&quot;)
180-
full_df$Pred_dates &lt;- as.Date(full_df$Pred_dates, &quot;%m/%d/%y&quot;)
181-
full_df$All_dates &lt;- as.Date(full_df$All_dates, &quot;%m/%d/%y&quot;)
182-
dat &lt;- full_df$All_dates[seq(1, length(full_df$All_dates), 7)]
183-
length(dat) &lt;- nrow(full_df)
184-
185-
pred &lt;- full_df$All_pred_y[seq(1, length(full_df$All_pred_y), 7)]
186-
length(pred) &lt;- nrow(full_df)
187-
pred2 &lt;- full_df$Train_y[seq(1, length(full_df$Train_y), 7)]
188-
length(pred2) &lt;- nrow(full_df)
189-
190-
full_df$dat &lt;-dat
191-
full_df$pred &lt;-pred
192-
full_df$pred2 &lt;-pred2
193-
194-
ggplot(data=full_df) +
195-
geom_ribbon(aes(x = All_dates, ymin = Q5, ymax = Q95, fill=&quot;Q5-Q95&quot;))+
196-
geom_ribbon(aes(x = All_dates, ymin = Q25, ymax = Q75, fill=&quot;Q25-Q75&quot;)) +
197-
geom_line(aes(x = dat, y = pred, color = &quot;Predicted Values&quot;))+
198-
geom_point(aes(x = dat, y = pred2, color = &quot;Actual Values&quot;))+
199-
labs(x = &quot;&quot;, y = &quot;&quot;,
200-
title = &quot;Hospital Utilization Prediction for Allegheny County&quot;,
201-
subtitle = &quot;With Cases2Beds Input&quot;,
202-
caption = &quot;Delphi Group, delphi.cmu.edu&quot;) +
203-
scale_colour_manual(&quot;&quot;,values=c( &quot;#00bfc4&quot;, &quot;black&quot;, &quot;black&quot;))+
204-
scale_fill_manual(&quot;&quot;,values=c(alpha(&quot;red&quot;, 0.5), alpha(&quot;#FF9999&quot;, 0.5)))+ theme(legend.position=&quot;bottom&quot;)</code></pre>
205-
<p><img src="/blog/2021-03-10_c2b_files/figure-html/HospUtil-1.svg" width="672" /></p>
206-
<p><strong>Fig. 4:</strong> Hospital Utilization Prediction vs. Usage for Allegheny County with Public Parameters</p>
177+
<p>By November, we had a prototype Cases2Beds spreadsheet for ACHD that they used. Over the following months, we made various modifications with their feedback. For example, the ACHD staff did not have time to input the case numbers. So, we were able to use the granular public data to give them estimates of future hospital utilization without any inputs on their end. We were also able to showcase the spreadsheet to other health departments and hospitals by generating public parameters for offset and length of stay from different national public resources, like the Florida line-level COVID dataset<sup><a href="#FloridaLineLevelLink">4</a></sup>. Based on these users’ feedback, we started to use Cases2Beds as an input to hospital utilization forecasting models. Other inputs included current hospital bed utilization (from HHS Protect<sup><a href="#HHSLink">5</a></sup>), how long current patients are likely to continue to be hospitalized, and how many new cases there will be in the near future. A preliminary evaluation of such a method shows decent predictive power when parameters are <em>tailored to a location</em>.</p>
207178
<p>At the peak of bed utilization, hospital systems themselves increased their COVID beds utilization to <em>6x</em> more than in October 2020. Fortunately, in Allegheny County, we never reached a point where demand for beds exceeded a somewhat elastic supply. By early January, multiple organizations told us that the pandemic’s most acute problem had changed to vaccine distribution and the number of COVID-19 beds needed dropped. Cases2Beds continues to act as an early warning system if the number of cases rise quickly, but hopefully the worst is now over.</p>
208179
<pre class="r"><code>full_df &lt;- tibble(read.csv(file=&quot;../../public/blog/2021-03-10_c2b/uncensored_HHS.csv&quot;))
209180
full_df$dates &lt;- as.Date(full_df$dates, &quot;%m/%d/%y&quot;)
@@ -219,8 +190,8 @@ <h2>The only constant during the pandemic is change</h2>
219190
caption = &quot;Delphi Group, delphi.cmu.edu, \n Data from HHS Protect &quot;) +
220191
theme_bw() +
221192
guides(color = FALSE)+ theme(legend.position = &quot;none&quot;)</code></pre>
222-
<p><img src="/blog/2021-03-10_c2b_files/figure-html/HHS-1.svg" width="672" /></p>
223-
<p><strong>Fig. 5:</strong> Numbers of staffed COVID beds over time vs. capacity from the HHS Protect Data<sup><a href="#HHSLink">5</a></p>
193+
<p><img src="/blog/2021-03-10_c2b_files/figure-html/HHS-1.svg" width="864" class="wide-figure" /></p>
194+
<p><strong>Fig. 4:</strong> Numbers of staffed COVID beds over time vs. capacity from the HHS Protect Data<sup><a href="#HHSLink">5</a></p>
224195
</div>
225196
<div id="conclusion" class="section level2">
226197
<h2>Conclusion</h2>

0 commit comments

Comments
 (0)