chapter 11: simple linear regression (slr) and...

18
Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis tests for β 0 and β 1 Coefficient of Determination, R 2 Sections 11-4 & 11-7.2 For SLR, a common hypothesis test is the test for a linear relationship between X and Y . H 0 : β 1 =0 (no linear relationship) H 1 : β 1 6=0 Under the assumption i iid N (02 ), we have ˆ β 0 N β 0 , σ 2 1 n + ¯ x 2 n i=1 (x i - ¯ x) 2 ˆ β 1 N β 1 , σ 2 n i=1 (x i - ¯ x) 2 1

Upload: others

Post on 11-Oct-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

Chapter 11: SIMPLE LINEARREGRESSION (SLR)AND CORRELATION

Part 3: Hypothesis tests for β0 and β1Coefficient of Determination, R2

Sections 11-4 & 11-7.2

• For SLR, a common hypothesis test is thetest for a linear relationship between X and Y.

H0 : β1 = 0 (no linear relationship)H1 : β1 6= 0

• Under the assumption εiiid∼ N(0, σ2), we

have

β0 ∼ N(β0, σ2

(1n + x2∑n

i=1(xi−x)2

))

β1 ∼ N(β1,

σ2∑ni=1(xi−x)2

)1

Page 2: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

• Test of interest

H0 : β1 = 0 (no linear relationship)H1 : β1 6= 0

• Since we will be estimating σ2, we will use at-statistic:

T0 =β1 − 0

se(β1)=

β1√σ2∑n

i=1(xi−x)2

Under H0 true, T0 ∼ tn−2.

From our observed test statistic t0, we cancompute a p-value and make decison on thehypothesis test.

2

Page 3: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

Example: The chloride concentration data(revisited)

Testing for a linear relationship between chlo-ride concentration (Y) and % of watershed inroadways (X)

H0 : β1 = 0H1 : β1 6= 0

Estimates:β1 = 20.567

se(β1) =√

13.80923.0106 = 2.1417

Test statistic:

t0 =β1 − 0

se(β1)=

20.567

2.1417= 9.603

Under H0 true, T0 ∼ t16

3

Page 4: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

P-value:2×P (T0 > 9.603) = 4.81× 10−8

{very small}

Reject H0.

There IS statistically significant evidence thatthe slope is not 0, so there is evidence of alinear relationship between chloride concen-tration and % of watershed in roadways.

●●●●

● ●

● ●●

●●

0.5 1.0 1.5

510

1520

2530

3540

roadway area in watershed (%)

chlo

ride

conc

entr

atio

n (m

g/lit

er)

4

Page 5: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

• Similarly, we can run a hypothesis test thatthe intercept equals 0...

H0 : β0 = 0H1 : β0 6= 0

The test statistic:

T0 =β0 − 0

se(β0)=

β0√σ2(

1n + x2∑n

i=1(xi−x)2

)Under H0 true, T0 ∼ tn−2.

————————————————————

• Example: The chloride concentration data(revisited)

Testing if the intercept is zero.

H0 : β0 = 0H1 : β0 6= 0

5

Page 6: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

Estimates:β0 = 0.4705

se(β0) =

√13.8092

(118 + 0.80612

3.0106

)= 1.9358

Test statistic:

t0 =β0 − 0

se(β0)=

0.4705

1.9358= 0.2431

Under H0 true, T0 ∼ t16

P-value:2× P (T0 > 0.2431) = 0.8110

Fail to reject H0. We do not have evidence tosuggest the intercept is anything other thanzero. (So, a watershed with no roadways essentially

has a chloride concentration of 0 mg/liter.)

6

Page 7: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

MINITAB OUTPUT:

Regression Analysis: y versus x

The regression equation is

y = 0.47 + 20.6 x

Predictor Coef SE Coef T P

Constant 0.470 1.936 0.24 0.811

x 20.567 2.142 9.60 0.000

S = 3.71607

7

Page 8: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

CorrelationSection 11-8

• Earlier we discussed the correlation coeffi-cient between Y and X , denoted as ρ, where

ρ =cov(X, Y )√V (X)V (Y )

=σXYσXσY

.

• For example, in the bivariate normal:

ρ = 0.95

• ρ is a parameter of interest to be estimatedfrom the data.

8

Page 9: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

• The sample correlation coefficient r(denoted R in our book) measures thestrength of a linear relationshipin the observed data.

• r has a number of different formulas...

r =

∑ni=1(Xi − X)(Yi − Y )√∑n

i=1(Xi − X)2∑ni=1(Yi − Y )2

=SXSY· β1

• The sample correlation coefficient r estimatesthe population correlation coefficient ρ

9

Page 10: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

• Possible values for r:

Correlation Example: Cigarette data

> correlation(Tar,Nic) 0.9766076

●●

●●

0 5 10 15 20 25 30

0.5

1.0

1.5

2.0

Tar

Nic

With r near +1, this shows a very strongpositive linear association.

10

Page 11: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

• r...– is a unitless measure, and −1 ≤ r ≤ 1

– near -1 or +1 shows a strong linear rela-tionship

– near 0 suggests no relationship

– a positive r is associated with an estimatedpositive slope

– a negative r is associated with an esti-mated negative slope

– r is NOT used to measure strength of acurved line

– In simple linear regression, r2 is the Coeffi-cient of Determination R2 discussed next.

11

Page 12: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

Simple Linear RegressionTotal corrected sum of squares (SST )Secton 11-4.2

•We use the total corrected sum of squares ofY, or SST , to quantify the total variabil-ity in the response.

SST =∑ni=1(yi − y)2

• Total sum of squares quantifies the overallsquared distance of the Y -values from theoverall mean of the responses Y

We can look at this graphically...

12

Page 13: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

0 2 4 6

−10

010

2030

x

y

●●

●●

●●

● ●

●●

●●

●●

●●

● ●

Y−bar= 10.91

• For regression, we can ‘decompose’ the dis-tance of an observation yi from the overallmean y and write:

13

Page 14: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

yi − y = (yi − yi) + (yi − y)︸ ︷︷ ︸ ︸ ︷︷ ︸distance from distance from

observation to fitted line to

fitted line overall mean

0 2 4 6

−10

010

2030

x

y

●●

●●

●●

● ●

●●

●●

●●

●●

● ●

Y−bar= 10.91

14

Page 15: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

•Which leads to the equation:

n∑i=1

(yi− y)2 =

n∑i=1

(yi− yi)2 +

n∑i=1

(yi− y)2

or

SST = SSE + SSR

where SSR is the regression sum of squares

• Total variability has been decomposed into“explained” variability (SSR) and “unexplained”variability (SSE)

• In general, when the proportion of total vari-ability that is explained is high, we have agood fitting model

15

Page 16: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

• The proportion of total variability that is ex-plained by the model is called the Coeffi-cient of Determination (denoted R2):

– R2 = SSRSST

– R2 = 1− SSESST

– 0 ≤ R2 ≤ 1

– R2 near 1 suggests a good fit to the data

– if R2 = 1, ALL points fall exactly on theline

– Different disciplines have different viewson what is a high R2, in other words whatis a good model...

16

Page 17: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

∗ social scientists may get excited aboutan R2 near 0.30

∗ a researcher with a designed experimentmay want to see an R2 near 0.80 orhigher

NOTE: Coefficient of Determination is dis-cussed in section 11-7.2

17

Page 18: Chapter 11: SIMPLE LINEAR REGRESSION (SLR) AND …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch11_pt3.pdfChapter 11: SIMPLE LINEAR REGRESSION (SLR) AND CORRELATION Part 3: Hypothesis

Example: The chloride concentration data(revisited)

MINITAB OUTPUT:

Regression Analysis: y versus x

The regression equation is

y = 0.47 + 20.6 x

Predictor Coef SE Coef T P

Constant 0.470 1.936 0.24 0.811

x 20.567 2.142 9.60 0.000

S = 3.71607 R-Sq = 85.22%

Coefficient of Determination: R2 = SSRSST

= 0.8522

R interpretation:85.22% of the total variability in chloride con-centration is explained by the model (or by thepercentage of roadway area in watershed, sincethis is the only predictor in the model).

18