Models

Lecture 16

Dr. Elijah Meyer + Konnie Huang

Duke University
STA 199 - Fall 2022

October 24, 2022

Checklist

– Clone ae-15

Announcements

– Lab Feedback

Goals

– Modeling with single predictors

– How to write equations

– Interpret Slopes

– Interpret Intercepts

Warm Up - Correlation vs Causation

Review - Why we Model?

Review - Why we Model?

– Prediction

– Mathematical Model of Relationships

Review - How are Models Fit?

Review - How are Models Fit?

Review - How are Models Fit?

  • What about in the categorical case?

How we model - linear case

linear_reg() |>

set_engine(“lm”) |>

fit(y ~ x , data = data-set ) |>

tidy()

In Summary

– “For a 1 unit increase in x….”

On Average: Property of least squares regression- Line goes through the mean of x and y

– Practice writing out equations: Population and Sample level