Lecture 9Simple Linear Regression 第九章 简单线性回归分析_第1页
Lecture 9Simple Linear Regression 第九章 简单线性回归分析_第2页
Lecture 9Simple Linear Regression 第九章 简单线性回归分析_第3页
Lecture 9Simple Linear Regression 第九章 简单线性回归分析_第4页
Lecture 9Simple Linear Regression 第九章 简单线性回归分析_第5页
已阅读5页,还剩69页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Chapter12SimpleLinearRegressionBusinessStatistics:AFirstCourse

FifthEdition1LearningObjectivesInthischapter,youlearn:

HowtouseregressionanalysistopredictthevalueofadependentvariablebasedonanindependentvariableThemeaningoftheregressioncoefficientsb0andb1HowtoevaluatetheassumptionsofregressionanalysisandknowwhattodoiftheassumptionsareviolatedTomakeinferencesabouttheslopeandcorrelationcoefficientToestimatemeanvaluesandpredictindividualvalues2Correlationvs.RegressionAscatterplotcanbeusedtoshowtherelationshipbetweentwovariablesCorrelationanalysisisusedtomeasurethestrengthoftheassociation(linearrelationship)betweentwovariablesCorrelationisonlyconcernedwithstrengthoftherelationshipNocausaleffectisimpliedwithcorrelationScatterplotswerefirstpresentedinCh.2CorrelationwasfirstpresentedinCh.33Introductionto

RegressionAnalysisRegressionanalysisisusedto:PredictthevalueofadependentvariablebasedonthevalueofatleastoneindependentvariableExplaintheimpactofchangesinanindependentvariableonthedependentvariableDependentvariable:thevariablewewishto predictorexplainIndependentvariable:thevariableusedtopredict orexplainthedependent variable4SimpleLinearRegressionModelOnlyoneindependentvariable,XRelationshipbetweenXandYisdescribedbyalinearfunctionChangesinYareassumedtoberelatedtochangesinX5TypesofRelationshipsYXYXYYXXLinearrelationshipsCurvilinearrelationships6TypesofRelationshipsYXYXYYXXStrongrelationshipsWeakrelationships(continued)7TypesofRelationshipsYXYXNorelationship(continued)8LinearcomponentSimpleLinearRegressionModelPopulation

YinterceptPopulationSlope

CoefficientRandomErrortermDependentVariableIndependentVariableRandomErrorcomponent9(continued)RandomErrorforthisXivalueYXObservedValueofYforXiPredictedValueofYforXi

XiSlope=β1Intercept=β0

εiSimpleLinearRegressionModel10ThesimplelinearregressionequationprovidesanestimateofthepopulationregressionlineSimpleLinearRegressionEquation(PredictionLine)Estimateoftheregression

interceptEstimateoftheregressionslope

Estimated(orpredicted)YvalueforobservationiValueofXforobservationi11TheLeastSquaresMethodb0andb1areobtainedbyfindingthevaluesofthatminimizethesumofthesquareddifferencesbetweenYand:12FindingtheLeastSquaresEquationThecoefficientsb0andb1,andotherregressionresultsinthischapter,willbefoundusingExcelorMinitabFormulasareshowninthetextforthosewhoareinterested13b0istheestimatedmeanvalueofYwhenthevalueofXiszerob1istheestimatedchangeinthemeanvalueofYasaresultofaone-unitchangeinXInterpretationofthe

SlopeandtheIntercept14SimpleLinearRegressionExampleArealestateagentwishestoexaminetherelationshipbetweenthesellingpriceofahomeanditssize(measuredinsquarefeet)Arandomsampleof10housesisselectedDependentvariable(Y)=housepricein$1000sIndependentvariable(X)=squarefeet15SimpleLinearRegressionExample:DataHousePricein$1000s(Y)SquareFeet(X)245140031216002791700308187519911002191550405235032424503191425255170016SimpleLinearRegressionExample:ScatterPlotHousepricemodel:ScatterPlot17SimpleLinearRegressionExample:UsingExcel18SimpleLinearRegressionExample:ExcelOutputRegressionStatisticsMultipleR0.76211RSquare0.58082AdjustedRSquare0.52842StandardError41.33032Observations10ANOVA

dfSSMSFSignificanceFRegression118934.934818934.934811.08480.01039Residual813665.56521708.1957Total932600.5000

CoefficientsStandardErrortStatP-valueLower95%Upper95%Intercept98.2483358.033481.692960.12892-35.57720232.07386SquareFeet0.109770.032973.329380.010390.033740.18580Theregressionequationis:19SimpleLinearRegressionExample:MinitabOutputTheregressionequationisPrice=98.2+0.110SquareFeet

Predictor

Coef

SECoef

T

PConstant

98.25

58.03

1.69

0.129SquareFeet

0.10977

0.03297

3.33

0.010

S=41.3303

R-Sq=58.1%

R-Sq(adj)=52.8%

AnalysisofVariance

Source

DF

SS

MS

F

PRegression

1

18935

18935

11.08

0.010ResidualError

8

13666

1708Total

9

32600Theregressionequationis:houseprice=98.24833+ 0.10977(squarefeet)20SimpleLinearRegressionExample:GraphicalRepresentationHousepricemodel:ScatterPlotandPredictionLineSlope=0.10977Intercept=98.24821SimpleLinearRegressionExample:Interpretationofbob0istheestimatedmeanvalueofYwhenthevalueofXiszero(ifX=0isintherangeofobservedXvalues)Becauseahousecannothaveasquarefootageof0,b0hasnopracticalapplication22SimpleLinearRegressionExample:Interpretingb1b1estimatesthechangeinthemeanvalueofYasaresultofaone-unitincreaseinXHere,b1=0.10977tellsusthatthemeanvalueofahouseincreasesby0.10977($1000)=$109.77,onaverage,foreachadditionalonesquarefootofsize23Predictthepriceforahousewith2000squarefeet:Thepredictedpriceforahousewith2000squarefeetis317.85($1,000s)=$317,850SimpleLinearRegressionExample:MakingPredictions24SimpleLinearRegressionExample:MakingPredictionsWhenusingaregressionmodelforprediction,onlypredictwithintherelevantrangeofdataRelevantrangeforinterpolationDonottrytoextrapolatebeyondtherangeofobservedX’s25MeasuresofVariationTotalvariationismadeupoftwoparts:TotalSumofSquaresRegressionSumofSquaresErrorSumofSquareswhere:

=Meanvalueofthedependentvariable

Yi=Observedvalueofthedependentvariable =PredictedvalueofYforthegivenXivalue26SST=totalsumofsquares(TotalVariation)MeasuresthevariationoftheYivaluesaroundtheirmeanYSSR=regressionsumofsquares(ExplainedVariation)VariationattributabletotherelationshipbetweenXandYSSE=errorsumofsquares(UnexplainedVariation)VariationinYattributabletofactorsotherthanX(continued)MeasuresofVariation27(continued)XiYXYiSST

=

(Yi

-

Y)2SSE

=

(Yi

-

Yi)2

SSR=

(Yi

-

Y)2

___Y

YY_Y

MeasuresofVariation28ThecoefficientofdeterminationistheportionofthetotalvariationinthedependentvariablethatisexplainedbyvariationintheindependentvariableThecoefficientofdeterminationisalsocalledr-squaredandisdenotedasr2CoefficientofDetermination,r2note:29r2=1Examplesofr2ValuesYXYXr2=1r2=1PerfectlinearrelationshipbetweenXandY:100%ofthevariationinYisexplainedbyvariationinX30Examplesofr2ValuesYXYX0<r2<1WeakerlinearrelationshipsbetweenXandY:SomebutnotallofthevariationinYisexplainedbyvariationinX31Examplesofr2Valuesr2=0NolinearrelationshipbetweenXandY:ThevalueofYdoesnotdependonX.(NoneofthevariationinYisexplainedbyvariationinX)YXr2=032SimpleLinearRegressionExample:CoefficientofDetermination,r2inExcelRegressionStatisticsMultipleR0.76211RSquare0.58082AdjustedRSquare0.52842StandardError41.33032Observations10ANOVA

dfSSMSFSignificanceFRegression118934.934818934.934811.08480.01039Residual813665.56521708.1957Total932600.5000

CoefficientsStandardErrortStatP-valueLower95%Upper95%Intercept98.2483358.033481.692960.12892-35.57720232.07386SquareFeet0.109770.032973.329380.010390.033740.1858058.08%ofthevariationinhousepricesisexplainedbyvariationinsquarefeet33SimpleLinearRegressionExample:CoefficientofDetermination,r2inMinitabTheregressionequationisPrice=98.2+0.110SquareFeet

Predictor

Coef

SECoef

T

PConstant

98.25

58.03

1.69

0.129SquareFeet

0.10977

0.03297

3.33

0.010

S=41.3303

R-Sq=58.1%

R-Sq(adj)=52.8%

AnalysisofVariance

Source

DF

SS

MS

F

PRegression

1

18935

18935

11.08

0.010ResidualError

8

13666

1708Total

9

3260058.08%ofthevariationinhousepricesisexplainedbyvariationinsquarefeet34StandardErrorofEstimateThestandarddeviationofthevariationofobservationsaroundtheregressionlineisestimatedbyWhere SSE=errorsumofsquares n=samplesize35SimpleLinearRegressionExample:

StandardErrorofEstimateinExcelRegressionStatisticsMultipleR0.76211RSquare0.58082AdjustedRSquare0.52842StandardError41.33032Observations10ANOVA

dfSSMSFSignificanceFRegression118934.934818934.934811.08480.01039Residual813665.56521708.1957Total932600.5000

CoefficientsStandardErrortStatP-valueLower95%Upper95%Intercept98.2483358.033481.692960.12892-35.57720232.07386SquareFeet0.109770.032973.329380.010390.033740.1858036SimpleLinearRegressionExample:

StandardErrorofEstimateinMinitabTheregressionequationisPrice=98.2+0.110SquareFeet

Predictor

Coef

SECoef

T

PConstant

98.25

58.03

1.69

0.129SquareFeet

0.10977

0.03297

3.33

0.010

S=41.3303

R-Sq=58.1%

R-Sq(adj)=52.8%

AnalysisofVariance

Source

DF

SS

MS

F

PRegression

1

18935

18935

11.08

0.010ResidualError

8

13666

1708Total

9

3260037ComparingStandardErrorsYYXXSYXisameasureofthevariationofobservedYvaluesfromtheregressionlineThemagnitudeofSYXshouldalwaysbejudgedrelativetothesizeoftheYvaluesinthesampledatai.e.,SYX=$41.33Kis

moderatelysmallrelativetohousepricesinthe$200K-$400Krange38LinearityTherelationshipbetweenXandYislinearIndependenceofErrorsErrorvaluesarestatisticallyindependentNormalityofErrorErrorvaluesarenormallydistributedforanygivenvalueofXEqualVariance(alsocalledhomoscedasticity)Theprobabilitydistributionoftheerrorshasconstantvariance39ResidualAnalysisTheresidualforobservationi,ei,isthedifferencebetweenitsobservedandpredictedvalueChecktheassumptionsofregressionbyexaminingtheresidualsExamineforlinearityassumptionEvaluateindependenceassumptionEvaluatenormaldistributionassumptionExamineforconstantvarianceforalllevelsofX(homoscedasticity)GraphicalAnalysisofResidualsCanplotresidualsvs.X40ResidualAnalysisforLinearityNotLinearLinear

xresidualsxYxYxresiduals41ResidualAnalysisforIndependenceNotIndependentIndependentXXresidualsresidualsXresiduals

42CheckingforNormalityExaminetheStem-and-LeafDisplayoftheResidualsExaminetheBoxplotoftheResidualsExaminetheHistogramoftheResidualsConstructaNormalProbabilityPlotoftheResiduals43ResidualAnalysisforNormalityPercentResidualWhenusinganormalprobabilityplot,normalerrorswillapproximatelydisplayinastraightline-3-2-10123010044ResidualAnalysisfor

EqualVarianceNon-constantvariance

ConstantvariancexxYxxYresidualsresiduals45SimpleLinearRegressionExample:ExcelResidualOutputRESIDUALOUTPUTPredictedHousePriceResiduals1251.92316-6.9231622273.8767138.123293284.85348-5.8534844304.062843.9371625218.99284-19.992846268.38832-49.388327356.2025148.797498367.17929-43.179299254.667464.3326410284.85348-29.85348Doesnotappeartoviolateanyregressionassumptions46InferencesAbouttheSlopeThestandarderroroftheregressionslopecoefficient(b1)isestimatedbywhere:

=Estimateofthestandarderroroftheslope =Standarderroroftheestimate47InferencesAbouttheSlope:

tTestttestforapopulationslopeIstherealinearrelationshipbetweenXandY?NullandalternativehypothesesH0:β1=0 (nolinearrelationship)H1:β1

≠0 (linearrelationshipdoesexist)Teststatistic

where:b1=regressionslopecoefficient

β1=hypothesizedslopeSb1=standarderroroftheslope48InferencesAbouttheSlope:

tTestExampleHousePricein$1000s(y)SquareFeet(x)2451400312160027917003081875199110021915504052350324245031914252551700EstimatedRegressionEquation:Theslopeofthismodelis0.1098Istherearelationshipbetweenthesquarefootageofthehouseanditssalesprice?49InferencesAbouttheSlope:

tTestExampleH0:β1=0H1:β1

≠0FromExceloutput:

CoefficientsStandardErrortStatP-valueIntercept98.2483358.033481.692960.12892SquareFeet0.109770.032973.329380.01039b1Predictor

Coef

SECoef

T

PConstant

98.25

58.03

1.69

0.129SquareFeet

0.10977

0.03297

3.33

0.010FromMinitaboutput:b150InferencesAbouttheSlope:

tTestExampleTestStatistic:tSTAT=3.329ThereissufficientevidencethatsquarefootageaffectshousepriceDecision:RejectH0RejectH0RejectH0a/2=.025-tα/2DonotrejectH00tα/2a/2=.025-2.30602.30603.329d.f.=10-2=8H0:β1=0H1:β1≠051InferencesAbouttheSlope:

tTestExampleH0:β1=0H1:β1≠0FromExceloutput:

CoefficientsStandardErrortStatP-valueIntercept98.2483358.033481.692960.12892SquareFeet0.109770.032973.329380.01039p-valueThereissufficientevidencethatsquarefootageaffectshouseprice.Decision:RejectH0,sincep-value<αPredictor

Coef

SECoef

T

PConstant

98.25

58.03

1.69

0.129SquareFeet

0.10977

0.03297

3.33

0.010FromMinitaboutput:52FTestforSignificanceFTeststatistic:

where

whereFSTATfollowsanFdistributionwith1numerator

and(n–2)denominatordegreesoffreedom

53F-TestforSignificance

ExcelOutputRegressionStatisticsMultipleR0.76211RSquare0.58082AdjustedRSquare0.52842StandardError41.33032Observations10ANOVA

dfSSMSFSignificanceFRegression118934.934818934.934811.08480.01039Residual813665.56521708.1957Total932600.5000

With1and8degreesoffreedomp-valuefortheF-Test54F-TestforSignificance

MinitabOutputAnalysisofVariance

Source

DF

SS

MS

F

PRegression

1

18935

18935

11.08

0.010ResidualError

8

13666

1708Total

9

32600With1and8degreesoffreedomp-valuefortheF-Test55H0:β1=0H1:β1≠0

=.05df1=1df2=8TestStatistic:Decision:Conclusion:RejectH0at

=0.05Thereissufficientevidencethathousesizeaffectssellingprice0

=.05F.05=5.32RejectH0DonotrejectH0CriticalValue:F

=5.32FTestforSignificance(continued)F56ConfidenceIntervalEstimate

fortheSlopeConfidenceIntervalEstimateoftheSlope:ExcelPrintoutforHousePrices:At95%levelofconfidence,theconfidenceintervalfortheslopeis(0.0337,0.1858)

CoefficientsStandardErrortStatP-valueLower95%Upper95%Intercept98.2483358.033481.692960.12892-35.57720232.07386SquareFeet0.109770.032973.329380.010390.033740.18580d.f.=n-257Sincetheunitsofthehousepricevariableis$1000s,weare95%confidentthattheaverageimpactonsalespriceisbetween$33.74and$185.80persquarefootofhousesize

CoefficientsStandardErrortStatP-valueLower95%Upper95%Intercept98.2483358.033481.692960.12892-35.57720232.07386SquareFeet0.109770.032973.329380.010390.033740.18580This95%confidenceintervaldoesnotinclude0.Conclusion:Thereisasignificantrelationshipbetweenhousepriceandsquarefeetatthe.05levelofsignificanceConfidenceIntervalEstimate

fortheSlope(continued)58tTestforaCorrelationCoefficientHypotheses H0:ρ=0 (nocorrelationbetweenXandY)

H1:ρ

≠0 (correlationexists)Teststatistic

(withn–2degreesoffreedom)59t-testForACorrelationCoefficientIsthereevidenceofalinearrelationshipbetweensquarefeetandhousepriceatthe.05levelofsignificance?H0:ρ

=0(Nocorrelation)H1:ρ

≠0(correlationexists)

=.05,df

=

10-2=8(continued)60t-testForACorrelationCoefficientConclusion:

Thereisevidenceofalinearassociationatthe5%levelofsignificanceDecision:

RejectH0RejectH0RejectH0a/2=.025-tα/2DonotrejectH00tα/2a/2=.025-2.30602.30603.329d.f.=10-2=8(continued)61EstimatingMeanValuesandPredictingIndividualValuesYX

XiY=b0+b1Xi

ConfidenceIntervalforthemeanofY,givenXiPredictionIntervalforanindividualY,givenXiGoal:FormintervalsaroundYtoexpressuncertaintyaboutthevalueofYforagivenXiY

62ConfidenceIntervalfor

theAverageY,GivenXConfidenceintervalestimateforthemeanvalueofYgivenaparticularXiSizeofintervalvariesaccordingtodistanceawayfrommean,

X63PredictionIntervalfor

anIndividualY,GivenXPredictionintervalestimateforanIndividualvalueofYgivenaparticularXiThisextratermaddstotheintervalwidthtoreflecttheaddeduncertaintyforanindividualcase64EstimationofMeanValues:ExampleFindthe95%confidenceintervalforthemeanpriceof2,000square-foothousesPredictedPriceYi=317.85($1,000s)

ConfidenceIntervalEstimateforμY|X=XTheconfidenceintervalendpointsare280.66and354.90,orfrom$280,660to$354,900i65EstimationofIndividualValues:ExampleFindthe95%predictionintervalforanindividualhousewith2,000squarefeetPredictedPriceYi=317.85($1,000s)

PredictionIntervalEstimateforYX=XThepredictionintervalendpointsare215.50and420.07,orfrom$215,500to$420,070i66FindingConfidenceand

PredictionIntervalsinExcelFromExcel,use PHStat|regression|simplelinearregression…Checkthe “confidenceandpredictionintervalforX=〞boxandentertheX-valueandconfidenceleveldesired67InputvaluesFindingConfidenceand

PredictionIntervalsinExcel(continued)ConfidenceInt

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论