An R Cookbook for Public Health

Course Materials for PHC 6099: ‘R Computing for Health Sciences’

Author
Affiliations

Gabriel Odom

Florida International University

Robert Stempel College of Public Health and Social Work

0.1 Source Code for PHC6099 Course Notes

This material is for the course “R Computing for Health Sciences”. The course notes are published here: https://gabrielodom.github.io/PHC6099_rBiostat/

0.1.1 Topics

The chapters are:

  1. Exploring Data
    • ggplot2:: mosaic plots, histograms, and violin plots
    • ggplot2:: scatterplots and facets
    • skimr::
    • table1::
    • gtsummary::
  2. One-Sample Tests
    • \(Z\)-test
    • Paired \(t\)-test
    • Paired Wilcoxon test
    • Transformations to Normality
    • McNemar’s Test
    • Fisher’s Exact Test
    • Chi-Square Goodness of Fit
    • Bootstrapped Confidence Intervals
  3. Two-Sample Tests
    • \(t\)-test
    • Welch’s \(t\)-test
    • Mann-Whitney \(U\) test
    • Cochran’s \(Q\) test
    • \(\chi^2\) Test for Independence
  4. ANOVA and Linear Regression
    • One-Way ANOVA
    • Two-way ANOVA
    • Welch’s ANOVA
    • Kruskal-Wallace Test
    • Tukey HSD Post-Hoc Test
    • Repeated Measures ANOVA
    • Random Intercept Models
    • Correlation Matrices and Covariances
    • Multiple Regression (linear)
    • Polynomial regression
  5. Generalized Linear Models
    • Generalized Linear Models: Binary
    • Generalized Linear Models: Ordered
    • Generalized Linear Models: Count (Poisson)
    • Generalized Linear Models: Count (Negative Binomial)
  6. Special Topics
    • Linear Mixed Effects Models
    • Structural Equation Models
    • Cox Proportional Hazards Regression
    • (TBD) Multivariate Methods for Genetics/Genomics
    • Ridge, LASSO, and Elastic Net Regression
  7. Power Calculations (in progress)

0.1.2 Lesson Outline

This is a shell of a lesson that can be copied and pasted for new lessons (or to edit and clean up existing lessons). If you copy this shell, then change all the headings from level 4 to 2. Replace <the method> with the name of your method, or its abbreviation. The file lessons/00_lesson_template.qmd has a .qmd template with these sections.

0.1.2.1 Introduction to <the method>

0.1.2.2 Mathematical definition of <the method>

0.1.2.3 Data source and description

0.1.2.4 Cleaning the data to create a model data frame

0.1.2.5 Assumptions of <the method>

0.1.2.6 Checking the assumptions with plots

0.1.2.7 Code to run <the method>

0.1.2.8 Code output

0.1.2.9 Brief interpretation of the output