Skip to content

Commit 70f50f9

Browse files
committed
Rebuild posts accordingly
1 parent 1f42de6 commit 70f50f9

File tree

9 files changed

+5846
-6899
lines changed

9 files changed

+5846
-6899
lines changed

content/blog/2020-08-26-fb-survey.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
survey data. The COVIDcast API, which serves these estimates and is updated
3737
daily, is a much larger effort run by the Delphi group, and our entire
3838
engineering team is owed a lot of credit here. Ryan came up with the
39-
idea of running the surveys, and worked with Facebook to make this a reality.
39+
idea of running the surveys, and worked with Facebook to make this a reality.
4040
On the Facebook side, Curtiss Cobb and Jonathan McKay played big roles. The
4141
University of Maryland team, including Adrianne Bradford and Samantha Chiu and
4242
led by Frauke Kreuter, made many contributions to the survey design.
@@ -47,7 +47,6 @@
4747
toc: true
4848
---
4949

50-
<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>
5150
<link href="/rmarkdown-libs/anchor-sections/anchor-sections.css" rel="stylesheet" />
5251
<script src="/rmarkdown-libs/anchor-sections/anchor-sections.js"></script>
5352

@@ -57,8 +56,7 @@
5756
<li><a href="#why-run-these-surveys">Why Run These Surveys?</a></li>
5857
<li><a href="#whats-in-the-survey">What’s in the Survey?</a></li>
5958
<li><a href="#some-interesting-examples">Some Interesting Examples</a></li>
60-
<li><a href="#basic-correlation-analysis">Basic Correlation Analysis</a>
61-
<ul>
59+
<li><a href="#basic-correlation-analysis">Basic Correlation Analysis</a><ul>
6260
<li><a href="#correlations-sliced-by-time">Correlations Sliced by Time</a></li>
6361
<li><a href="#correlations-sliced-by-county">Correlations Sliced by County</a></li>
6462
</ul></li>
@@ -156,22 +154,23 @@ <h2>Short Background</h2>
156154
df_fb_avg = df_fb %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
157155
df_in_avg = df_in %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
158156

159-
# Set a bunch of fields so that the data frames know how to plot themselves
160-
df_fb_avg$time_value = df_in_avg$time_value = start_day
161-
df_fb_avg$issue = df_in_avg$issue = start_day
162-
attributes(df_fb_avg)$metadata$geo_type = &quot;state&quot;
163-
attributes(df_in_avg)$metadata$geo_type = &quot;state&quot;
164-
class(df_fb_avg) = c(&quot;covidcast_signal&quot;, class(df_fb_avg))
165-
class(df_in_avg) = c(&quot;covidcast_signal&quot;, class(df_in_avg))
157+
# Turn these into covidcast_signal data frames that can be mapped
158+
df_fb_avg = df_fb_avg %&gt;%
159+
mutate(time_value = start_day) %&gt;%
160+
as.covidcast_signal(signal = &quot;fb_avg&quot;, geo_type = &quot;state&quot;)
161+
162+
df_in_avg = df_in_avg %&gt;%
163+
mutate(time_value = start_day) %&gt;%
164+
as.covidcast_signal(signal = &quot;in_avg&quot;, geo_type = &quot;state&quot;)
166165

167166
# Plot choropleth maps, using the covidcast plotting functionality
168167
subtitle = paste(&quot;Averaged over&quot;, start_day, &quot;to&quot;, end_day)
169168
p1 = plot(df_fb_avg,
170169
title = &quot;% of people with COVID symptoms, based on Facebook surveys&quot;,
171-
range=c(0, 1), choro_params = list(subtitle = subtitle))
170+
range = c(0, 1), choro_params = list(subtitle = subtitle))
172171
p2 = plot(df_in_avg,
173172
title = &quot;Daily new confirmed COVID-19 cases per 100,000 people&quot;,
174-
range=c(0, 30), choro_params = list(subtitle = subtitle))
173+
range = c(0, 30), choro_params = list(subtitle = subtitle))
175174
grid.arrange(p1, p2, nrow = 1)</code></pre>
176175
<p><img src="/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-2-1.svg" width="960" class="wide-figure" /></p>
177176
<p>We generated these plots using our <a href="https://cmu-delphi.github.io/covidcast/covidcastR/">covidcast R
@@ -517,12 +516,13 @@ <h3>Correlations Sliced by County</h3>
517516
either that county had below 500 cumulative COVID-19 cases,
518517
or we didn’t have enough data from the surveys in
519518
order to estimate % CLI and % CLI-in-community signals there.</p>
520-
<pre class="r"><code># Set a bunch of fields so that the data frames know how to plot themselves
521-
df_cor1$time_value = df_cor2$time_value = start_day
522-
df_cor1$issue = df_cor2$issue = start_day
523-
attributes(df_cor1)$metadata$geo_type = &quot;county&quot;
524-
attributes(df_cor2)$metadata$geo_type = &quot;county&quot;
525-
class(df_cor1) = class(df_cor2) = c(&quot;covidcast_signal&quot;, &quot;data.frame&quot;)
519+
<pre class="r"><code># Use as.covidcast_signal to turn these into mappable signals
520+
df_cor1 = df_cor1 %&gt;%
521+
mutate(time_value = start_day) %&gt;%
522+
as.covidcast_signal(signal = &quot;cor1&quot;)
523+
df_cor2 = df_cor2 %&gt;%
524+
mutate(time_value = start_day) %&gt;%
525+
as.covidcast_signal(signal = &quot;cor1&quot;)
526526

527527
# Plot choropleth maps, using the covidcast plotting functionality
528528
p1 = plot(df_cor1, title = &quot;Correlation between % CLI and case rates&quot;,

content/blog/2020-10-14-dv-signal.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
summary: |
1818
In previous posts, we discussed our massive ongoing symptom surveys that have reached over 12 million people in the U.S. since April 2020, in partnership with Facebook and Google. Another one of our major data initiatives is based on partnerships with healthcare systems, granting us access to various aggregate statistics from hospital records and insurance claims covering 10-15% of the United States population. From these data, we can extract informative indicators that can be early indicators of COVID activity. This post focuses on one indicator in particular, based on outpatient visits, and demonstrates both the challenges and promises associated with medical records data.
1919
acknowledgements: |
20-
Maria Jahja contributed immensely to every stage of this project, from determining which ICD codes to use to the final implementation of the indicator.
21-
Aaron Rumack devised the weekday adjustment and analyzed the performance of the DV indicator.
20+
Maria Jahja contributed immensely to every stage of this project, from determining which ICD codes to use to the final implementation of the indicator.
21+
Aaron Rumack devised the weekday adjustment and analyzed the performance of the DV indicator.
2222
Roni Rosenfeld worked closely with our health systems partners to get access to the data and provided domain knowledge to ensure that the data was useful. Both Roni and Ryan Tibshirani provided helpful suggestions and insights towards the methodology and analysis.
2323

2424
output:
@@ -28,7 +28,6 @@
2828
toc: true
2929
---
3030

31-
<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>
3231
<link href="/rmarkdown-libs/anchor-sections/anchor-sections.css" rel="stylesheet" />
3332
<script src="/rmarkdown-libs/anchor-sections/anchor-sections.js"></script>
3433

@@ -88,13 +87,13 @@ <h2>The Doctor Visits Indicator</h2>
8887
df_dv_avg = df_dv %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
8988
df_in_avg = df_in %&gt;% group_by(geo_value) %&gt;% summarize(value = mean(value))
9089

91-
# Set a bunch of fields so that the data frames know how to plot themselves
92-
df_dv_avg$time_value = df_in_avg$time_value = start_day
93-
df_dv_avg$issue = df_in_avg$issue = start_day
94-
attributes(df_dv_avg)$metadata$geo_type = &quot;state&quot;
95-
attributes(df_in_avg)$metadata$geo_type = &quot;state&quot;
96-
class(df_dv_avg) = c(&quot;covidcast_signal&quot;, class(df_dv_avg))
97-
class(df_in_avg) = c(&quot;covidcast_signal&quot;, class(df_in_avg))
90+
# Use as.covidcast_signal to turn these into covidcast data frames
91+
df_dv_avg &lt;- df_dv_avg %&gt;%
92+
mutate(time_value = start_day) %&gt;%
93+
as.covidcast_signal(signal = &quot;dv_avg&quot;, geo_type = &quot;state&quot;)
94+
df_in_avg &lt;- df_in_avg %&gt;%
95+
mutate(time_value = start_day) %&gt;%
96+
as.covidcast_signal(signal = &quot;in_avg&quot;, geo_type = &quot;state&quot;)
9897

9998
# Plot choropleth maps, using the covidcast plotting functionality
10099
subtitle = paste(&quot;Averaged over&quot;, start_day, &quot;to&quot;, end_day)
@@ -317,8 +316,12 @@ <h2>Spatial Heterogeneity</h2>
317316
ungroup()
318317

319318
df_cor_by_time_adj = covidcast_cor(
320-
dv_cases_df %&gt;% mutate(value = dv*slope_6wk + int_6wk, issue = time_value),
321-
dv_cases_df %&gt;% mutate(value = cases, issue = time_value),
319+
dv_cases_df %&gt;%
320+
mutate(value = dv*slope_6wk + int_6wk, issue = time_value) %&gt;%
321+
as.covidcast_signal(signal = &quot;dv_cases&quot;),
322+
dv_cases_df %&gt;%
323+
mutate(value = cases, issue = time_value) %&gt;%
324+
as.covidcast_signal(signal = &quot;dv_cases&quot;),
322325
by = &quot;time_value&quot;,
323326
method = &quot;spearman&quot;)
324327

static/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-2-1.svg

Lines changed: 1342 additions & 210 deletions
Loading

static/blog/2020-08-26-fb-survey_files/figure-html/unnamed-chunk-4-1.svg

Lines changed: 13 additions & 13 deletions
Loading

0 commit comments

Comments
 (0)