Labs
Labs are hands-on R sessions that provide an opportunity to practice deploying concepts learned in the lectures. Each lab has a handout you can read in the browser and a starter bundle (project file, scripts, and README) to download and work from. Lab deliverables are yours to keep; they are not collected or graded.
- Opens the lab handout in the browser.
- Downloads the starter files (zip).
- Downloads the answer packet (answer key and completed scripts). Unzip it into your lab folder, next to the starter files.
Each starter bundle can be downloaded as a self-contained file that includes everything you need to run the lab. Material for later labs will be posted here as the course progresses. Datasets used in the lecture notes live on the Data page.
Lab 1: Emulating a Target Trial with ICU Data Build an analytic dataset from the eICU demo database, from protocol and eligibility through exposure, outcome, and quality control. | |
Lab 2: The Case-Cohort Design Draw a 20% subcohort plus all cases from the Lab 1 cohort, build the time-varying weights, and check weighted risk-curve, risk-ratio, and risk-difference estimates against the fully enumerated cohort. | |
Lab 3: Three Questions Fit one logistic regression to the Lab 1 cohort before asking any question, then read the same printout three times — descriptively, predictively, and causally — writing down the estimand and the assumptions each reading needs. | |
Lab 4: Dissect a Regression Model Turn one dial of one model at a time on the Lab 1 cohort: change the link (identity, log, logit) and compare fitted values; add an offset and watch a risk ratio become a rate ratio; fit death against age as a line, a spline, and a saturated model, and visualize the parametric-to-nonparametric spectrum. |
eICU attribution. The Lab 1 bundle redistributes the eICU Collaborative Research Database Demo (v2.0.1), and the Lab 2, Lab 3, and Lab 4 bundles a dataset derived from it, under the Open Data Commons Open Database License v1.0. Please cite: Pollard T, Johnson A, Raffa J, Celi LA, Badawi O, Mark R. eICU Collaborative Research Database Demo (version 2.0.1). PhysioNet, 2021. doi:10.13026/4mxk-na84; and the companion paper: Pollard et al., Scientific Data 2018;5:180178. Documentation: eicu.mit.edu.