Vis u ali z ation of Linear Models C OR R E L ATION AN D R E G R - - PowerPoint PPT Presentation

vis u ali z ation of linear models
SMART_READER_LITE
LIVE PREVIEW

Vis u ali z ation of Linear Models C OR R E L ATION AN D R E G R - - PowerPoint PPT Presentation

Vis u ali z ation of Linear Models C OR R E L ATION AN D R E G R E SSION IN R Ben Ba u mer Assistant Professor at Smith College Poss u ms ggplot(data = possum, aes(y = totalL, x = tailL)) + geom_point() CORRELATION AND REGRESSION IN R Thro


slide-1
SLIDE 1

Visualization of Linear Models

C OR R E L ATION AN D R E G R E SSION IN R

Ben Baumer

Assistant Professor at Smith College

slide-2
SLIDE 2

CORRELATION AND REGRESSION IN R

Possums

ggplot(data = possum, aes(y = totalL, x = tailL)) + geom_point()

slide-3
SLIDE 3

CORRELATION AND REGRESSION IN R

Through the origin

ggplot(data = possum, aes(y = totalL, x = tailL)) + geom_point() + geom_abline(intercept = 0, slope = 2.5)

slide-4
SLIDE 4

CORRELATION AND REGRESSION IN R

Through the origin, better fit

ggplot(data = possum, aes(y = totalL, x = tailL)) + geom_point() + geom_abline(intercept = 0, slope = 1.7)

slide-5
SLIDE 5

CORRELATION AND REGRESSION IN R

Not through the origin

ggplot(data = possum, aes(y = totalL, x = tailL)) + geom_point() + geom_abline(intercept = 40, slope = 1.3)

slide-6
SLIDE 6

CORRELATION AND REGRESSION IN R

The "best" fit line

ggplot(data = possum, aes(y = totalL, x = tailL)) + geom_point() + geom_smooth(method = "lm")

slide-7
SLIDE 7

CORRELATION AND REGRESSION IN R

Ignore standard errors

ggplot(data = possum, aes(y = totalL, x = tailL)) + geom_point() + geom_smooth(method = "lm", se = FALSE)

slide-8
SLIDE 8

Let's practice!

C OR R E L ATION AN D R E G R E SSION IN R

slide-9
SLIDE 9

Understanding Linear Models

C OR R E L ATION AN D R E G R E SSION IN R

Ben Baumer

Assistant Professor at Smith College

slide-10
SLIDE 10

CORRELATION AND REGRESSION IN R

Generic statistical model

slide-11
SLIDE 11

CORRELATION AND REGRESSION IN R

Generic linear model

slide-12
SLIDE 12

CORRELATION AND REGRESSION IN R

Regression model

slide-13
SLIDE 13

CORRELATION AND REGRESSION IN R

Fitted values

slide-14
SLIDE 14

CORRELATION AND REGRESSION IN R

Residuals

slide-15
SLIDE 15

CORRELATION AND REGRESSION IN R

Fitting procedure

slide-16
SLIDE 16

CORRELATION AND REGRESSION IN R

Least squares

Easy, deterministic, unique solution Residuals sum to zero Line must pass through ( , ) Other criteria exist—just not in this course

x ¯ y ¯

slide-17
SLIDE 17

CORRELATION AND REGRESSION IN R

Key concepts

Y-hat is expected value given corresponding X Beta-hats are estimates of true, unknown betas Residuals (e's) are estimates of true, unknown epsilons "Error" may be misleading term—beer: noise

slide-18
SLIDE 18

Let's practice!

C OR R E L ATION AN D R E G R E SSION IN R

slide-19
SLIDE 19

Regression vs. regression to the mean

C OR R E L ATION AN D R E G R E SSION IN R

Ben Baumer

Assistant Professor at Smith College

slide-20
SLIDE 20

CORRELATION AND REGRESSION IN R

Heredity

Galton's "regression to the mean" Thought experiment: consider the heights of the children of NBA players

slide-21
SLIDE 21

CORRELATION AND REGRESSION IN R

Galton's data

slide-22
SLIDE 22

CORRELATION AND REGRESSION IN R

Regression modeling

"Regression": techniques for modeling a quantitative response Types of regression models: Least squares Weighted Generalized Nonparametric Ridge Bayesian . . .

slide-23
SLIDE 23

Let's practice!

C OR R E L ATION AN D R E G R E SSION IN R