Skip to content

Commit 5f26ff1

Browse files
committed
cleaning up notebook and adding details
1 parent 162152e commit 5f26ff1

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

nhsn/DETAILS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
We import the NHSN Weekly Hospital Respiratory Data
44

55
There are 2 sources we grab data from for nhsn:
6+
Note that they are from the same source, but with different cadence and one reporting preliminary data for the previous reporting week
67

78
Primary source: https://data.cdc.gov/Public-Health-Surveillance/Weekly-Hospital-Respiratory-Data-HRD-Metrics-by-Ju/ua7e-t2fy/about_data
89
Secondary (preliminary source): https://data.cdc.gov/Public-Health-Surveillance/Weekly-Hospital-Respiratory-Data-HRD-Metrics-by-Ju/mpgq-jmmr/about_data
@@ -17,3 +18,13 @@ Secondary (preliminary source): https://data.cdc.gov/Public-Health-Surveillance/
1718
* `confirmed_admissions_flu`: total number of confirmed admission for flu
1819
* `prelim_confirmed_admissions_covid`: total number of confirmed admission for covid from preliminary source
1920
* `prelim_confirmed_admissions_flu`: total number of confirmed admission for flu from preliminary source
21+
22+
## Additional Notes
23+
HHS dataset and NHSN dataset covers the equivalent data of hospital admission for covid and flu.
24+
As a general trend, HHS and NHSN data matches pretty well.
25+
However, there are differences between some of the states, notably for GA (untill 2023), LA, NV, PR (late 2020-early 2021), TN all have HHS substantially lower, HHS is substantially lower than NHSN.
26+
27+
Some states have this spike in NHSN or hhs where the other source doesn't have a spike and spikes don't happen at the same time_values across states
28+
29+
More details regarding the analysis is available in the [analysis.ipynb](notebook%2Fanalysis.ipynb)
30+
(may require installing additional packages to work)

nhsn/notebook/analysis.ipynb

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
{
22
"cells": [
3+
{
4+
"metadata": {},
5+
"cell_type": "markdown",
6+
"source": [
7+
"# Setup\n",
8+
"install plotly\n",
9+
"locally run nhsn indicator in order to generate the data\n",
10+
"get api key for epidata and fill in the API_KEY \n"
11+
],
12+
"id": "ac71b219bacb886e"
13+
},
314
{
415
"metadata": {
516
"ExecuteTime": {
6-
"end_time": "2024-12-06T19:45:51.446614Z",
7-
"start_time": "2024-12-06T19:45:51.442106Z"
17+
"end_time": "2024-12-06T21:05:46.881968Z",
18+
"start_time": "2024-12-06T21:05:46.869306Z"
819
}
920
},
1021
"cell_type": "code",
@@ -24,7 +35,7 @@
2435
],
2536
"id": "initial_id",
2637
"outputs": [],
27-
"execution_count": 94
38+
"execution_count": 106
2839
},
2940
{
3041
"metadata": {
@@ -127,10 +138,6 @@
127138
},
128139
"cell_type": "code",
129140
"source": [
130-
"import pandas as pd\n",
131-
"import plotly.graph_objects as go\n",
132-
"import plotly.io as pio\n",
133-
"\n",
134141
"from plotly.offline import init_notebook_mode\n",
135142
"\n",
136143
"init_notebook_mode(connected=True)\n",
@@ -203,9 +210,7 @@
203210
},
204211
"cell_type": "code",
205212
"source": [
206-
"import plotly.graph_objects as go\n",
207213
"from plotly.offline import init_notebook_mode\n",
208-
"import plotly.io as pio\n",
209214
"\n",
210215
"init_notebook_mode(connected=True)\n",
211216
"\n",
@@ -286,8 +291,6 @@
286291
"cell_type": "code",
287292
"source": [
288293
"import pandas as pd\n",
289-
"import plotly.graph_objects as go\n",
290-
"import plotly.io as pio\n",
291294
"from plotly.offline import init_notebook_mode\n",
292295
"\n",
293296
"init_notebook_mode(connected=True)\n",
@@ -387,9 +390,7 @@
387390
},
388391
"cell_type": "code",
389392
"source": [
390-
"import plotly.graph_objects as go\n",
391393
"from plotly.offline import init_notebook_mode\n",
392-
"import plotly.io as pio\n",
393394
"\n",
394395
"init_notebook_mode(connected=True)\n",
395396
"\n",
@@ -988,8 +989,6 @@
988989
"metadata": {},
989990
"cell_type": "code",
990991
"source": [
991-
"from itertools import product\n",
992-
"\n",
993992
"pathogen_mapping = {\"flu\": \"influenza\", \"covid\": \"covid\"}\n",
994993
"pathogen = \"covid\"\n",
995994
"prelim_flag = False\n",

0 commit comments

Comments
 (0)