• A Minimal Book Example
  • Epidemiology in R: A Hands-on Approach
  • Preface
  • 1 Introduction to Epidemiology
  • 2 Working with this book
    • 2.1 What is bookdown?
    • 2.2 Code snippets
    • 2.3 A Hand’s-on Approach
  • 3 Getting Started with R
    • 3.1 Installing R and Rstudio
    • 3.2 Starting to code
    • 3.3 R Projects and Organization
  • 4 R fundamentals
    • 4.1 Basic Datatypes in R
    • 4.2 Special datatypes
    • 4.3 Converting between datatypes
    • 4.4 Data structures in R
      • 4.4.1 Vectors: The Building Blocks
      • 4.4.2 Lists: Mixed Data Collections
      • 4.4.3 Data Frames: The Excel of R
      • 4.4.4 Indexing: Accessing Your Data
    • 4.5 Conditions and Comparisons
    • 4.6 Conditional execution with
    • 4.7 Repeating lines of code
    • 4.8 Functions
  • 5 Introduction to the Tidyverse
    • 5.1 Data Structure: Wide vs. Tidy Data
      • 5.1.1 Understanding the Difference
      • 5.1.2 Reshaping Data with tidyr
    • 5.2 Core dplyr Functions for Data Manipulation
      • 5.2.1 The Pipe Operator (%>%)
      • 5.2.2 select(): Choose Columns
      • 5.2.3 filter(): Choose Rows
      • 5.2.4 mutate(): Create or Modify Columns
      • 5.2.5 transmute(): Create New Columns (Drop Others)
      • 5.2.6 arrange(): Sort Rows
      • 5.2.7 group_by() and summarise(): Group Operations
    • 5.3 Additional Essential Functions
      • 5.3.1 rename(): Change Column Names
      • 5.3.2 Data Type Conversions
      • 5.3.3 across(): Apply Functions to Multiple Columns
      • 5.3.4 recode(): Recode Values
      • 5.3.5 case_when(): Multiple Conditional Logic
      • 5.3.6 replace_na(): Handle Missing Values
      • 5.3.7 which(): Find Positions
    • 5.4 Practical Example: Data Analysis Workflow
    • 5.5 Function Summary Table
    • 5.6 Conclusion
  • 6 Data Visualization in R
    • 6.1 ggplot2: The Grammar of Graphics
      • 6.1.1 Basic ggplot2 Structure
    • 6.2 Basic Plot Types
      • 6.2.1 Scatter Plots with geom_point()
      • 6.2.2 Line Plots with geom_line()
      • 6.2.3 Bar Plots with geom_col() and geom_bar()
      • 6.2.4 Histograms with geom_histogram()
      • 6.2.5 Box Plots with geom_boxplot()
    • 6.3 Aesthetic Mappings
      • 6.3.1 Understanding aes()
      • 6.3.2 Fixed vs. Mapped Aesthetics
    • 6.4 Faceting: Small Multiples
      • 6.4.1 facet_wrap()
      • 6.4.2 facet_grid()
    • 6.5 Statistical Transformations
      • 6.5.1 Smooth Lines with geom_smooth()
      • 6.5.2 Statistical Summaries
    • 6.6 Scales: Controlling Aesthetic Mappings
      • 6.6.1 Color Scales
      • 6.6.2 Axis Scales
    • 6.7 Coordinates and Transformations
    • 6.8 Labels and Themes
      • 6.8.1 Adding Labels
      • 6.8.2 Theme Customization
    • 6.9 Heatmaps
    • 6.10 Combining Multiple Geoms
    • 6.11 Text and Annotations
    • 6.12 Practical Example: Complex Multi-layered Plot
    • 6.13 ggplot2 Function Summary Table
    • 6.14 Tips and Tricks
    • 6.15 Conclusion
    • 6.16 My favorite figures I ever made
  • 7 Statistics
    • 7.1 Descriptive statistics and outbreak investigation
      • 7.1.1 Introduction
      • 7.1.2 Loading and Exploring the Data
      • 7.1.3 Data Preparation: Creating a Tidy Dataset
      • 7.1.4 Initial Visual Exploration
      • 7.1.5 Comparing Cases and Controls
      • 7.1.6 Statistical Analysis: Attack Rates and Odds Ratios
      • 7.1.7 Calculating Statistics for Our Data
      • 7.1.8 Interpretation of Results
      • 7.1.9 Conclusion
    • 7.2 Inferential statistics in epidemiology
    • 7.3 Inferential Statistics in Epidemiology
      • 7.3.1 Understanding Statistical Significance
      • 7.3.2 Comparing Demographics Between Cases and Controls
      • 7.3.3 Testing Food Exposures: Statistical Significance of Associations
      • 7.3.4 Confidence Intervals for Odds Ratios
      • 7.3.5 Interpreting the Results
      • 7.3.6 Key Statistical Concepts for Interpretation
      • 7.3.7 Summary
  • 8 Working with epidemiological data
    • 8.1 Acessing data
    • 8.2 (Imperfect) epidemiological data
    • 8.3 Case Study 1: Yellow Fever
  • 9 Case Study: Dengue Fever in Brazil
    • 9.1 Introduction
    • 9.2 Data Sources and Structure
    • 9.3 Data Import and Preparation
      • 9.3.1 Data Type Standardization
      • 9.3.2 Geographic Data Import
    • 9.4 Temporal Analysis: National Dengue Trends
    • 9.5 Spatial Analysis: Environmental Context
    • 9.6 Temporal-Spatial Analysis: Annual Incidence Maps
    • 9.7 Climate Oscillations: Large-Scale Environmental Drivers
    • 9.8 Ecological Analysis: Incidence by Environmental Zones
    • 9.9 Seasonal Analysis: Weekly Patterns by Biome
    • 9.10 Discussion and Key Findings
    • 9.11 Further Analysis Opportunities
  • 10 Modelling
    • 10.1 Compartmental models
      • 10.1.1 SIR model in theory
      • 10.1.2 SIR model in R
    • 10.2 Time series - Forecasting
    • 10.3 Using and applying models
  • 11 Communication and sharing of code and data
    • 11.1 Writing code: best practices
    • 11.2 Github
    • 11.3 Reports using Markdown
    • 11.4 Open science
    • 11.5 Communities and forums
    • 11.6 How to use Chat-GPT
  • 12 Recommended Reading
    • 12.1 Recommended textbooks and courses
    • 12.2 Datasources
    • 12.3 Useful packages
  • References
  • Published with bookdown

Epidemiology in R: A Hands-on Approach

Chapter 12 Recommended Reading

12.1 Recommended textbooks and courses

  • https://epirhandbook.com/en/new_pages/ggplot_basics.html: great pieces on ggplot (chapter 30)

12.2 Datasources

12.3 Useful packages