Topics Covered

Continuous Y ~ Continuous X

Standard Linear Regression: Predict body mass from flipper length. Intercept, slope, and residuals.

Continuous Y ~ Categorical X

Dummy Coding: How R handles factors (like sex) to estimate group differences in mass.

Categorical Y ~ Continuous X

Logistic Regression: Using GLM to predict binary outcomes (sex) with an S-shaped probability curve.

Visual Insights: Simpson's Paradox

Simple regression can be misleading if you ignore group structure. Notice how the trend reverses when sex is included.

Overall Trend

Aggregated Data

Simpson's Paradox

Disaggregated by Sex

Key Concepts

Homework

Resources