Download - 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

Transcript
Page 1: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum
Page 2: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

2.5.2Deriva+onsRecall:

Recall:

0

Page 3: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum
Page 4: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum
Page 5: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum
Page 6: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

Agevs.Money

Popula'on

Cashinpocketdollars($)

Popula+onparameters

HypothesisTest

Sample,n=9Samplesta+s+cs

β0, σ2β1,

H0:β1=0H1:β1≠0

82

22

4571

29

129

1824

x y

71

54

43452111304510

AgeinYears

PREDICTOR variable

x

RESPONSE variable

Y

b0=17.7b1=0.55s=15.5R2=0.49

Forparameterβ1:

simplelinearregression

Page 7: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

Agevs.MoneyObjec've: Thepurposeofthisobserva+onalstudywasto

demonstrateif,andtowhatextent,ageis associatedwithmoney.

DesignandMethods: Wecollectedarandomsampleofindividualsandforeach

determinedtheirage(recordedinyears)andtheamount ofmoney(indollars)intheiraccounts.Analysisof thedatawasdoneusinglinearregression.

Results: Weobtainedarandomsampleofn=9subjects. Thereisa

sta+s+callysignificantassocia+onbetweenageandmoney(p-value=0.036). Foreveryaddi'onalyearinage,anindividual’samountofmoneyincreases onaveragebyanes'matedof$0.55(95%C.I.=[$0.05,$1.05]).

Conclusions: Wefoundthat,ashypothesized,ageisassociatedwithmoney. Inoursampleageaccountedforabouthalfofthevariability observedinmoney(R2=0.49).Wepredictthata50yearoldwill have$45.1(95%P.I.=[$5.6,$84.5]),whereasa40year oldwillhave$39.6(95%P.I.=[$0.8,$78.4]).

SmallPrint: Theanalysisrestsonthefollowingassump+ons:

- theobserva+onsareindependentlyandiden+callydistributed. - theresponsevariable,money,isnormallydistributed. - Homoscedas+cityofresidualsorequalvariance. - therela+onshipbetweenresponseandpredictorvariablesislinear.

Page 8: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

“Ourresearch(usinglinearregression)indicatesthatolderpeopleholdandusemorecash.”

Page 9: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum
Page 10: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum
Page 11: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

Stat306:FindingRela+onshipsinData.

Lecture7Sec+on3.1Leastsquareswithtwoormore

explanatoryvariables

Page 12: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

Agevs.Money

Popula'on

Cashinpocketdollars($)

Popula+onparameters

HypothesisTest

Sample,n=9Samplesta+s+cs

β0, σ2β1,

H0:β1=0H1:β1≠0

82

22

4571

29

129

1824

x y

71

54

43452111304510

AgeinYears

PREDICTOR variable

x

RESPONSE variable

Y

b0=17.7b1=0.55s=15.5R2=0.49

Forparameterβ1:

simplelinearregression

Page 13: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

Agevs.Money

Popula'on Popula+onparameters

HypothesisTest

Sample,n=9Samplesta+s+cs

β0, σ2β1,β2,

H0:β1=0H1:β1≠0

82

22

4571

29

129

1824

x1 x2 y

71

54

43

4521113045

10

AgeinYearsIncomeinthousandsof$.

PREDICTOR variables

x1

x2

RESPONSE variable

Y

b0=23.26b1=0.68b2=-0.28s=13.9R2=0.65Forparameterβ1:

mul'plelinearregression

26

37

4976

40

20

1092

[0.18,1.18]

0.016

Cashinpocketdollars($)

Page 14: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

Chapter3

3.1Leastsquareswithtwoormoreexplanatoryvariables3.4Sta+s+calsogwareoutputformul+pleregression

-R2andadjR2and3.4.1Proper+esofR2andσ2-Sumofsquaresdecomposi+on

3.5Importantexplanatoryvariables3.6Intervales+matesandstandarderrors3.7DenominatoroftheresidualSD3.8Residualplots3.9Categoricalexplanatoryvariables3.10Par+alcorrela+on

Page 15: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 16: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

0 20 40 60 80 100

0

20

40

60

80

100

Age (years)

Mon

ey ($

)

predic'onequa'on:y=b0+b1x

Page 17: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

“hyperplaneequa'on”

Page 18: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

“hyperplaneequa'on”

Page 19: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Onceagainwecanminimizetheleastsquareswithsimplecalculus:

Page 20: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 21: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 22: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 23: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 24: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 25: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 26: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 27: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 28: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 29: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 30: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 31: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

designmatrixordatamatrix

Thesystemofnormalequa5ons

Page 32: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Asbefore,YisarandomvectorandXisfixed.

Page 33: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Asbefore,YisarandomvectorandXisfixed.

Page 34: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

Agevs.Money

Popula'on Popula+onparameters

HypothesisTest

Sample,n=9Samplesta+s+cs

β0, σ2β1,β2,

H0:β1=0H1:β1≠0

82

22

4571

29

129

1824

x1 x2 y

71

54

43

4521113045

10

AgeinYearsIncomeinthousandsof$.

PREDICTOR variables

x1

x2

RESPONSE variable

Y

b0=23.26b1=0.68b2=-0.28s=13.9R2=0.65Forparameterβ1:

mul'plelinearregression

26

37

4976

40

20

1092

[0.18,1.18]

0.016

Cashinpocketdollars($)

Page 35: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

Page 36: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

Chapter3

3.1Leastsquareswithtwoormoreexplanatoryvariables3.4Sta's'calsoUwareoutputformul'pleregression

-R2andadjR2and3.4.1Proper'esofR2andσ2-Sumofsquaresdecomposi'on

3.5Importantexplanatoryvariables3.6Intervales+matesandstandarderrors3.7DenominatoroftheresidualSD3.8Residualplots3.9Categoricalexplanatoryvariables3.10Par+alcorrela+on

Page 37: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum
Page 38: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.4Sta+s+calsogwareoutputfor

mul+pleregression

Page 39: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.4Sta+s+calsogwareoutputfor

mul+pleregression

Page 40: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.4Sta+s+calsogwareoutputfor

mul+pleregression

Page 41: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.4Sta+s+calsogwareoutputfor

mul+pleregression

Page 42: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

Agevs.Money

Popula'on Popula+onparameters

HypothesisTest

Sample,n=9Samplesta+s+cs

β0, σ2β1,β2,

H0:β1=0H1:β1≠0

82

22

4571

29

129

1824

x1 x2 y

71

54

43

4521113045

10

AgeinYearsIncomeinthousandsof$.

PREDICTOR variables

x1

x2

RESPONSE variable

Y

b0=23.26b1=0.68b2=-0.28s=13.9R2=0.65Forparameterβ1:

mul'plelinearregression

26

37

4976

40

20

1092

[0.18,1.18]

0.016

Cashinpocketdollars($)

Page 43: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

3.1Leastsquareswithtwoormoreexplanatoryvariables

“hyperplaneequa'on”

Page 44: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum

hips://commons.wikimedia.org/wiki/File:2d_mul+ple_linear_regression.gif

Page 45: 2.5.2 Derivaons...3.1 Least squares with two or more explanatory variables 3.4 Stas+cal sogware output for mul+ple regression 2 - R and adjR2 and 3.4.1 Proper+es of R2 and σ2 - Sum