Skip to content

Commit

Permalink
generated html for files with code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
minhkhul committed Nov 20, 2023
1 parent 302ce60 commit 17a1150
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 236 deletions.
19 changes: 10 additions & 9 deletions content/blog/2020-08-26-fb-survey.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,19 @@
toc: true
---

<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>

<div id="TOC">
<ul>
<li><a href="#short-background">Short Background</a></li>
<li><a href="#why-run-these-surveys">Why Run These Surveys?</a></li>
<li><a href="#whats-in-the-survey">What’s in the Survey?</a></li>
<li><a href="#some-interesting-examples">Some Interesting Examples</a></li>
<li><a href="#basic-correlation-analysis">Basic Correlation Analysis</a>
<li><a href="#short-background" id="toc-short-background">Short Background</a></li>
<li><a href="#why-run-these-surveys" id="toc-why-run-these-surveys">Why Run These Surveys?</a></li>
<li><a href="#whats-in-the-survey" id="toc-whats-in-the-survey">What’s in the Survey?</a></li>
<li><a href="#some-interesting-examples" id="toc-some-interesting-examples">Some Interesting Examples</a></li>
<li><a href="#basic-correlation-analysis" id="toc-basic-correlation-analysis">Basic Correlation Analysis</a>
<ul>
<li><a href="#correlations-sliced-by-time">Correlations Sliced by Time</a></li>
<li><a href="#correlations-sliced-by-county">Correlations Sliced by County</a></li>
<li><a href="#correlations-sliced-by-time" id="toc-correlations-sliced-by-time">Correlations Sliced by Time</a></li>
<li><a href="#correlations-sliced-by-county" id="toc-correlations-sliced-by-county">Correlations Sliced by County</a></li>
</ul></li>
<li><a href="#whats-next-with-the-surveys">What’s Next with the Surveys</a></li>
<li><a href="#whats-next-with-the-surveys" id="toc-whats-next-with-the-surveys">What’s Next with the Surveys</a></li>
</ul>
</div>

Expand Down Expand Up @@ -141,6 +140,8 @@ <h2>Short Background</h2>
library(dplyr)
library(gridExtra)

options(covidcast.auth = Sys.getenv(&quot;API_KEY&quot;)) # for more on API keys, see: https://cmu-delphi.github.io/delphi-epidata/api/api_keys.html

# Fetch Facebook % CLI signal and JHU confirmed case incidence proportion at
# the state level
start_day = &quot;2020-06-15&quot;
Expand Down
192 changes: 9 additions & 183 deletions content/blog/2020-08-28-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,14 @@
toc: true
---

<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>

<div id="TOC">
<ul>
<li><a href="#purpose-of-the-api">Purpose of the API</a></li>
<li><a href="#unique-data-sources">Unique Data Sources</a></li>
<li><a href="#tracking-observations-and-revisions">Tracking Observations and Revisions</a></li>
<li><a href="#accessing-the-api">Accessing the API</a></li>
<li><a href="#putting-the-api-to-work">Putting the API to Work</a></li>
<li><a href="#purpose-of-the-api" id="toc-purpose-of-the-api">Purpose of the API</a></li>
<li><a href="#unique-data-sources" id="toc-unique-data-sources">Unique Data Sources</a></li>
<li><a href="#tracking-observations-and-revisions" id="toc-tracking-observations-and-revisions">Tracking Observations and Revisions</a></li>
<li><a href="#accessing-the-api" id="toc-accessing-the-api">Accessing the API</a></li>
<li><a href="#putting-the-api-to-work" id="toc-putting-the-api-to-work">Putting the API to Work</a></li>
</ul>
</div>

Expand Down Expand Up @@ -294,182 +293,7 @@ <h2>Tracking Observations and Revisions</h2>
knitr::kable(&quot;html&quot;, digits = 2,
col.names = c(&quot;Test date&quot;, &quot;Positivity rate (%)&quot;, &quot;Sample size&quot;,
&quot;Issued on&quot;, &quot;Lag (days)&quot;))</code></pre>
<table>
<thead>
<tr>
<th style="text-align:left;">
Test date
</th>
<th style="text-align:right;">
Positivity rate (%)
</th>
<th style="text-align:right;">
Sample size
</th>
<th style="text-align:left;">
Issued on
</th>
<th style="text-align:right;">
Lag (days)
</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left;">
2020-08-01
</td>
<td style="text-align:right;">
1.01
</td>
<td style="text-align:right;">
198
</td>
<td style="text-align:left;">
2020-08-06
</td>
<td style="text-align:right;">
5
</td>
</tr>
<tr>
<td style="text-align:left;">
2020-08-01
</td>
<td style="text-align:right;">
0.97
</td>
<td style="text-align:right;">
206
</td>
<td style="text-align:left;">
2020-08-07
</td>
<td style="text-align:right;">
6
</td>
</tr>
<tr>
<td style="text-align:left;">
2020-08-01
</td>
<td style="text-align:right;">
1.41
</td>
<td style="text-align:right;">
284
</td>
<td style="text-align:left;">
2020-08-10
</td>
<td style="text-align:right;">
9
</td>
</tr>
<tr>
<td style="text-align:left;">
2020-08-01
</td>
<td style="text-align:right;">
1.38
</td>
<td style="text-align:right;">
290
</td>
<td style="text-align:left;">
2020-08-12
</td>
<td style="text-align:right;">
11
</td>
</tr>
<tr>
<td style="text-align:left;">
2020-08-01
</td>
<td style="text-align:right;">
1.33
</td>
<td style="text-align:right;">
377
</td>
<td style="text-align:left;">
2020-08-16
</td>
<td style="text-align:right;">
15
</td>
</tr>
<tr>
<td style="text-align:left;">
2020-08-01
</td>
<td style="text-align:right;">
1.53
</td>
<td style="text-align:right;">
459
</td>
<td style="text-align:left;">
2020-08-19
</td>
<td style="text-align:right;">
18
</td>
</tr>
<tr>
<td style="text-align:left;">
2020-08-01
</td>
<td style="text-align:right;">
1.47
</td>
<td style="text-align:right;">
477
</td>
<td style="text-align:left;">
2020-08-20
</td>
<td style="text-align:right;">
19
</td>
</tr>
<tr>
<td style="text-align:left;">
2020-08-01
</td>
<td style="text-align:right;">
1.46
</td>
<td style="text-align:right;">
479
</td>
<td style="text-align:left;">
2020-08-26
</td>
<td style="text-align:right;">
25
</td>
</tr>
<tr>
<td style="text-align:left;">
2020-08-01
</td>
<td style="text-align:right;">
1.36
</td>
<td style="text-align:right;">
513
</td>
<td style="text-align:left;">
2020-08-30
</td>
<td style="text-align:right;">
29
</td>
</tr>
</tbody>
</table>
<p><em>November 2023 update: Quidel data is no longer publicly available, so the table generated by the code chunk above has been removed.</em></p>
<p>Many data sources are subject to revisions:</p>
<ul>
<li>Case and death counts are frequently corrected or adjusted by authorities.</li>
Expand Down Expand Up @@ -556,13 +380,15 @@ <h2>Accessing the API</h2>
<pre class="python"><code>import covidcast
from datetime import date
import matplotlib.pyplot as plt
import os

covidcast.use_api_key(os.environ[&#39;API_KEY&#39;]) # for more on API keys, see: https://cmu-delphi.github.io/delphi-epidata/api/api_keys.html

data = covidcast.signal(&quot;fb-survey&quot;, &quot;smoothed_hh_cmnty_cli&quot;,
date(2020, 9, 8), date(2020, 9, 8),
geo_type=&quot;state&quot;)
covidcast.plot_choropleth(data, figsize=(7, 5))
plt.title(&quot;% who know someone who is sick, Sept 8, 2020&quot;)</code></pre>
<p><img src="/blog/2020-08-28-api_files/figure-html/python-data-1.svg" /><!-- --></p>
<p>Each package’s documentation gives numerous other examples of pulling, plotting,
and mapping data from our API. (Note that the Export Data feature in the map can
also show you example R or Python code to download any signal from the map.)
Expand Down
15 changes: 8 additions & 7 deletions content/blog/2020-09-18-google-survey.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@
toc: true
---

<script src="/rmarkdown-libs/header-attrs/header-attrs.js"></script>

<div id="TOC">
<ul>
<li><a href="#short-background">Short Background</a></li>
<li><a href="#cli-in-community">CLI-in-Community</a></li>
<li><a href="#our-two-surveys">Our Two Surveys</a></li>
<li><a href="#google-survey-redux">Google Survey Redux</a></li>
<li><a href="#short-background" id="toc-short-background">Short Background</a></li>
<li><a href="#cli-in-community" id="toc-cli-in-community">CLI-in-Community</a></li>
<li><a href="#our-two-surveys" id="toc-our-two-surveys">Our Two Surveys</a></li>
<li><a href="#google-survey-redux" id="toc-google-survey-redux">Google Survey Redux</a></li>
</ul>
</div>

Expand Down Expand Up @@ -138,6 +137,8 @@ <h2>CLI-in-Community</h2>
library(ggplot2)
library(gridExtra)

options(covidcast.auth = Sys.getenv(&quot;API_KEY&quot;)) # for more on API keys, see: https://cmu-delphi.github.io/delphi-epidata/api/api_keys.html

# Fetch county-level Google and Facebook % CLI-in-community signals, and JHU
# confirmed case incidence proportion
df_go = covidcast_signal(&quot;google-survey&quot;, &quot;smoothed_cli&quot;, geo_type = &quot;state&quot;)
Expand Down Expand Up @@ -195,7 +196,7 @@ <h2>CLI-in-Community</h2>
<p>In both plots, we see a reassuring trend,
but the trend on the left is noticeably stronger.
Indeed, the correlation here between the Google signal and case rates is
0.84,
0.83,
while that between the Facebook signal and case rates is
0.64.
To be fair, we should note that the Google signal comprises a much
Expand Down Expand Up @@ -330,7 +331,7 @@ <h2>Google Survey Redux</h2>
or manually (in collaboration with partners in public health and/or data
journalists). Stay tuned to the Delphi blog for updates.</p>
</div>
<div class="footnotes">
<div class="footnotes footnotes-end-of-document">
<hr />
<ol>
<li id="fn1"><p>In the survey methodology literature, a “proxy question” is one in which
Expand Down
Loading

0 comments on commit 17a1150

Please sign in to comment.