EOH 635: Environmental Epidemiology Methods
Asynchronous R Tutorials
Welcome! These tutorials walk through the R and analysis skills used in this course. Each lesson is interactive — the code runs live, right in your browser, via webR. You don’t need R or RStudio installed to work through them.
How to use these tutorials:
- Read through each section, and run the code chunks as you go (click Run Code).
- Sections marked 🧠 Your Turn ask you to write some code yourself before revealing the solution. Give it a real attempt first — the point is to practice, not just to read the answer.
- If you get stuck, click the collapsed “Solution” box to reveal the answer, then go back and make sure you understand why it works.
Lessons
- Lesson 1: Intro to R and Handling Data
- Lesson 2: Reading a Published Conceptual Framework — a reading/reflection activity applying exposure, outcome, mediator, confounder, and effect modifier vocabulary to a published greenspace-and-health framework
- Lesson 3: Exploratory Data Analysis & Data Cleaning
- Lesson 4: Exposure Assessment & Misclassification — coding decisions for a continuous exposure (NDVI), and how differential vs. non-differential misclassification bias an effect estimate, using a simulated dataset where the true exposure is known
- Lesson 5: Regression, Linearity & Dose-Response — choosing and fitting a crude regression model (logistic vs. log-binomial) for tree canopy and high blood pressure, interpreting the estimate, and checking the linearity assumption with categorical indicator terms
- Lesson 6: Confounding & Directed Acyclic Graphs (DAGs) — drawing a DAG in R to find a minimally sufficient adjustment set, then checking confounding in the data with the change-in-estimate approach (including modified Poisson regression when a log-binomial model won’t converge)
Reference
- Data Codebook — variable descriptions for
class_data_raw.csv