14
Linear regression DATA ANALYSIS 27 SEPTEMBER 2016 Fitting a straight line through a swarm of bivariate data

WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Embed Size (px)

Citation preview

Page 1: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Linear regressionDATA ANALYSIS27 SEPTEMBER 2016

Fitting a straight line through a swarm of bivariate data

Page 2: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Equation of a straight line

Y = a + bx

Page 3: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Linear regression lineY

X

(x, y)

e

a y = a + bx + e

b = y / x

Y = + X

Page 4: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Two hypotheses of interest… Is there no relationship between Y

and X in the population?• H0: yx = 0

Is the slope of the line = 0 in the population?• H0: = 0

Page 5: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Hypothesis tested about yx

Null hypothesis is H0: yx = 0

Alternate hypothesis is H1: yx ≠ 0

a = .05 Y = + X

Page 6: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Hypothesis tested about …Null hypothesis is H0: = 0

Alternate hypothesis is H1: ≠ 0

a = .05 Y = + X

Page 7: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Relationship betweencar mpg and car weight

Rscript

Console

Page 8: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Relationship betweencar mpg and car weight

Rscript

Console

a b

Page 9: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Relationship betweencar mpg and car weight

Rscript

Console

Page 10: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Relationship betweencar mpg and car weight

Rscript

Console

Page 11: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Relationship betweencar mpg and car weight

Rscript

Console

Page 12: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Confidence intervalsRscript

Console

Page 13: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Plot with regression line Rscript

Plot

Page 14: WF ED 540, CLASS MEETING 6, Linear Regression, 2016

Linear regressionDATA ANALYSIS27 SEPTEMBER 2016