BIOSTAT 214: Programming for Health Data Science in R II (Fall 2021)
Section outline
-
-
The online book covers the material discussed in Biostat214 and is updated regularly.
It serves as a reference to be used parallel to the in-class demonstration and discussion, not as a substitute.
Chapters to read ahead of class are listed in the weekly schedule. -
Discord invite URL
We will use Discord (https://discord.com/) for live chat during class and between classes.
Discord allows us to easily:- Share code with syntax highlighting
- Organize Q&A topics by channels and threads for easier navigation
- Screen share for troubleshooting
-
Core R language refresher
Faculty: Stathis Gennatas- Introductions
- Data types and structures
- Indexing; Aggregating
- Control flow
- Intro to Markdown/Rmarkdown
Location: Mission Hall 1400 -
Writing your own functionsBook chapter: Functions
- Writing R functions
- Warnings and errors
- Function scoping rules
Faculty: Stathis Gennatas
Location: Mission Hall 1400
-
Loop functions: the apply family
- Review Vectorization
- Review for-loops
- Loop functions: apply(), lapply(), sapply(), vapply(), tapply(), mapply()
- Anonymous functions
Book chapter: Loop Functions
Faculty: Stathis Gennatas
Location: Mission Hall 1400
-
Data frames & Data preprocessing
- Data frame operations
- Table joins
- Wide <-> long conversion
- Data transformations
- standardization
- binning
- one-hot encoding
Book chapters:
Take some time to get familiar with table joins and
reshaping (wide <-> long transformations) ahead of class.
Faculty: Stathis Gennatas
Location: Mission Hall 1400 -
Working with Strings
- String operations
- Regular expressions
Book chapter: String Operations
Faculty: Stathis Gennatas
Location: Mission Hall MH1400 -
Visualization
- base vs. grid graphics
- review of base graphics
- introduction to ggplot2
- introduction to interactive graphics with plotly
Book chapter: Base graphics; 3x Graphics
Faculty: Stathis Gennatas
Location: Mission Hall 1400 and Zoom -
Working with Date and Time data; the S3 class system
- The Date object
- Date formats
- Date operations
- The pipe operator: |> (base) and %>% (magrittr)
- The S3 class system and generic functions
Faculty: Stathis Gennatas
Location: Mission Hall 1400 & Zoom
-
No class - work on final project
-
Data transformations; Core Statistics & Hypothesis Testing
- Data transformations: scaling, centering, logs, binning, one-hot encoding
- T-test, Wilcoxon
- Analysis of variance, Kruskal-Walllis Test
- Chi-square test; Fisher's exact test
- The Generalized Linear Model
Book chapter: Data Transformations, Common statistical tests, Introduction to the GLM
Faculty: Stathis Gennatas
Location: Mission Hall 1400 / Zoom -
Efficient Data Analysis with data.table
- Reading data with fread()
- Setting column name & order, keys
- Fast filter, select, group by operations
- In-place data transformations and operations
- Table reshaping
- data.table joins
Book chapter: Efficient data analysis with data.table
also read: 2014 data.table talk
Faculty: Stathis Gennatas
Location: Mission Hall 1400 / Zoom
-
Handling missing Data; Profiling R code; Course review
- Handling missing data
- Benchmarking: microbenchmark
- Profiling: profvis
- Course review and project troubleshooting
Book chapters: Handling Missing Data, Benchmarking & Profiling
Faculty: Stathis Gennatas
Location: Zoom -
Project presentations
Location: Zoom

