Skip to content

Commit

Permalink
add background info
Browse files Browse the repository at this point in the history
  • Loading branch information
tompollard committed Feb 13, 2018
1 parent e55cd19 commit 635cb77
Show file tree
Hide file tree
Showing 2 changed files with 174 additions and 134 deletions.
254 changes: 135 additions & 119 deletions challenge-demo.ipynb

Large diffs are not rendered by default.

54 changes: 39 additions & 15 deletions jupyter_example_notebook_in_R.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,41 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# R Demo for the 2018 BHI & BSN Data Challenge\n",
"# R demo for the 2018 BHI & BSN Data Challenge\n",
"\n",
"This notebook provides a simple introduction to analysing the MIMIC-III database. It was created as a demonstrator for the [2018 BHI & BSN Data Challenge](https://mimic.physionet.org/events/bhibsn-challenge/), which explores the following question:\n",
"\n",
"> Are patients admitted to the intensive care unit (ICU) on a weekend more likely to die in the hospital than those admitted on a weekday?\n",
"\n",
"We have provided an example slide template for final presentations (`slide-template.pptx`) at: https://github.com/MIT-LCP/bhi-bsn-challenge. There is no obligation to use it!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Background on MIMIC-III\n",
"\n",
"MIMIC-III (‘Medical Information Mart for Intensive Care’) is a large, single-center database comprising information relating to patients admitted to critical care units at a large tertiary care hospital. \n",
"\n",
"Data includes vital signs, medications, laboratory measurements, observations and notes charted by care providers, fluid balance, procedure codes, diagnostic codes, imaging reports, hospital length of stay, survival data, and more. \n",
"\n",
"For details, see: https://mimic.physionet.org/. The data is downloaded as 26 CSV files, which can then be loaded into a database system. Scripts for loading the data into Postgres are provided in the [MIMIC Code Repository](https://mimic.physionet.org/gettingstarted/dbsetup/). A demo dataset is also available: https://mimic.physionet.org/gettingstarted/demo/\n",
"\n",
"Points to note:\n",
"\n",
"- A patient-level shift has been applied to dates. Day of week is retained. \n",
"- Patients aged >89 years on first admission have been reassigned an age of ~300 years.\n",
"- Patients may have multiple hospital admissions. Each hospital admission may comprise multiple ICU stays (e.g. a patient may visit the ICU, leave for surgery, and then return to the ICU for recovery, all within a single hospital admission).\n",
"\n",
"If you need help getting set up with access to MIMIC-III, please contact `[email protected]`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Connect to the MIMIC-III database\n",
"\n",
"The toughest part is often getting the database running and the software connecting to it. This is the way I usually do it:\n",
"\n",
Expand Down Expand Up @@ -108,8 +142,6 @@
"\n",
"###\n",
"\n",
"\n",
"\n",
"query = \"\n",
"WITH first_icu AS (\n",
" SELECT i.subject_id, i.hadm_id, i.icustay_id, i.gender, i.admittime admittime_hospital, \n",
Expand Down Expand Up @@ -306,7 +338,6 @@
}
],
"source": [
"\n",
"# Have a look at the dataset:\n",
"head(dat)\n",
"\n",
Expand Down Expand Up @@ -1031,7 +1062,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"In the first model (no interaction), we see that although the effect of weekend is almost halved, it remains statistically significant, after adjusting for admission type (p<0.001).\n",
Expand Down Expand Up @@ -1199,15 +1232,6 @@
"onWeekend %>% inner_join(onWeekday,by=\"admission_type\") %>% mutate(OR=exp((pred.x-pred.y)))\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -1238,7 +1262,7 @@
"mimetype": "text/x-r-source",
"name": "R",
"pygments_lexer": "r",
"version": "3.3.1"
"version": "3.4.3"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 635cb77

Please sign in to comment.