版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Chapter17SimpleLinearRegressionandCorrelation17.1LinearRegressionAnalysis…Regressionanalysisisusedtopredictthevalueofonevariable(thedependentvariable)onthebasisofothervariables(theindependentvariables).Dependentvariable:denotedYIndependentvariables:denotedX1,X2,…,XkIfweonlyhaveONEindependentvariable,themodeliswhichisreferredtoassimplelinearregression.Wewouldbeinterestedinestimatingβ0andβ1fromthedatawecollect.2LinearRegressionAnalysisVariables: X=IndependentVariable(weprovidethis) Y=DependentVariable(weobservethis)Parameters:
β0=Y-Intercept
β1=Slope
ε~NormalRandomVariable(με=0,σε=???)[Noise]3EffectofLargerValuesofσε
HousesizeHousePrice25K$Samesquarefootage,butdifferentpricepoints(e.g.décoroptions,cabinetupgrades,lotlocation…)Lowervs.HigherVariabilityHousePrice=25,000+75(Size)+4TheoreticalLinearModel51.BuildingtheModel–CollectDataTest2Grade=β0+β1*(Test1Grade)FromData: Estimateβ0
Estimateβ1 Estimateσε6LinearRegressionAnalysis…7CorrelationAnalysis…“-1<
<1”Ifweareinterestedonlyindeterminingwhetherarelationshipexists,weemploycorrelationanalysis.Example:Student’sheightandweight.8CorrelationAnalysis…“-1<
<1”Ifthecorrelationcoefficientiscloseto+1thatmeansyouhaveastrongpositiverelationship.Ifthecorrelationcoefficientiscloseto-1thatmeansyouhaveastrongnegativerelationship.Ifthecorrelationcoefficientiscloseto0thatmeansyouhavenocorrelation.WEHAVETHEABILITYTOTESTTHEHYPOTHESIS H0:=09Regression:ModelTypes…X=sizeofhouse,Y=costofhouseDeterministicModel:anequationorsetofequationsthatallowustofullydeterminethevalueofthedependentvariablefromthevaluesoftheindependentvariables.
y=$25,000+(75$/ft2)(x)Areaofacircle:A=*r2ProbabilisticModel:amethodusedtocapturetherandomnessthatispartofareal-lifeprocess.y=25,000+75x+εE.g.doallhousesofthesamesize(measuredinsquarefeet)sellforexactlythesameprice?10SimpleLinearRegressionModel…Meaningofand>0[positiveslope]<0[negativeslope]
yxrunrise=slope(=rise/run)=y-intercept11Whichlinehasthebest“fit”tothedata????12EstimatingtheCoefficients…Inmuchthesamewaywebaseestimatesofon,weestimatewithb0andwithb1,they-interceptandslope(respectively)oftheleastsquaresorregressionlinegivenby:(Thisisanapplicationoftheleastsquaresmethodanditproducesastraightlinethatminimizesthesumofthesquareddifferencesbetweenthepointsandtheline)13LeastSquaresLine…Thislineminimizesthesumofthesquareddifferencesbetweenthepointsandtheline……butwheredidthelineequationcomefrom?Howdidweget.934foray-interceptand2.114forslope??thesedifferencesarecalledresidualsorerrors14LeastSquaresLine…[suregladwehavecomputersnow!]Thecoefficientsb1andb0fortheleastsquaresline……arecalculatedas:15DataStatisticsInformationDataPoints:xy16213945517612y=.934+2.114xLeastSquaresLine…SeeifyoucanestimateY-interceptandslopefromthisdataRecall…16LeastSquaresLine…SeeifyoucanestimateY-interceptandslopefromthisdata17Excel:DataAnalysis-Regression18Excel:PlottedRegressionModel–Youwillneedtoplayaroundwiththistogettheplottolook“Good”
19RequiredConditions…Fortheseregressionmethodstobevalidthefollowingfourconditionsfortheerrorvariable()mustbemet:•Theprobabilitydistributionofisnormal.•Themeanofthedistributionis0;thatis,E()=0.•Thestandarddeviationofis,whichisaconstantregardlessofthevalueofx.•Thevalueofassociatedwithanyparticularvalueofyisindependentofassociatedwithanyothervalueofy.20AssessingtheModel…Theleastsquaresmethodwillalwaysproduceastraightline,evenifthereisnorelationshipbetweenthevariables,oriftherelationshipissomethingotherthanlinear.Hence,inadditiontodeterminingthecoefficientsoftheleastsquaresline,weneedtoassessittoseehowwellit“fits”thedata.We’llseetheseevaluationmethodsnow.They’rebasedonthewhatiscalledsumofsquaresforerrors(SSE).21SumofSquaresforError(SSE–anotherthingtocalculate)…Thesumofsquaresforerroriscalculatedas:andisusedinthecalculationofthestandarderrorofestimate:Ifiszero,allthepointsfallontheregressionline.22StandardError…Ifissmall,thefitisexcellentandthelinearmodelshouldbeusedforforecasting.Ifislarge,themodelispoor…Butwhatissmallandwhatislarge?23StandardError…Judgethevalueofbycomparingittothesamplemeanofthedependentvariable().Inthisexample, =.3265and =14.841so(relativelyspeaking)itappearstobe“small”,henceourlinearregressionmodelofcarpriceasafunctionofodometerreadingis“good”.24TestingtheSlope…Exceloutputdoesthisforyou.Ifnolinearrelationshipexistsbetweenthetwovariables,wewouldexpecttheregressionlinetobehorizontal,thatis,tohaveaslopeofzero.Wewanttoseeifthereisalinearrelationship,i.e.wewanttoseeiftheslope()issomethingotherthanzero.Ourresearchhypothesisbecomes: H1:≠0Thusthenullhypothesisbecomes: H0:=0Alreadydiscussed!25TestingtheSlope…Wecanimplementthisteststatistictotryourhypotheses:H0:β1=0whereisthestandarddeviationofb1,definedas:Iftheerrorvariable()isnormallydistributed,theteststatistichasaStudentt-distributionwithn–2degreesoffreedom.Therejectionregiondependsonwhetherornotwe’redoingaone-ortwo-tailtest(two-tailtestismosttypical).26Example17.4…Testtodetermineiftheslopeissignificantlydifferentfrom“0”(at5%significancelevel)Wewanttotest: H1:≠0 H0:=0(ifthenullhypothesisistrue,nolinearrelationshipexists)Therejectionregionis:ORcheckthep-value.27Example17.4…WecancomputetmanuallyorrefertoourExceloutput…Weseethatthetstatisticfor“odometer”(i.e.theslope,b1)is–13.49whichisgreaterthantCritical=–1.984.Wealsonotethatthep-valueis0.000.Thereisoverwhelmingevidencetoinferthatalinearrelationshipbetweenodometerreadingandpriceexists.COMPUTEComparep-value28TestingtheSlope…Wecanalsoestimate(tosomelevelofconfidence)andintervalfortheslopeparameter,.Recallthatyourestimateforisb1.Theconfidenceintervalestimatorisgivenas:Hence:Thatis,weestimatethattheslopecoefficientliesbetween–.0768and–.057029CoefficientofDetermination…Teststhusfarhaveshownifalinearrelationshipexists;itisalsousefultomeasurethestrengthoftherelationship.Thisisdonebycalculatingthecoefficientofdetermination–R2.Thecoefficientofdeterminationisthesquareofthecoefficientofcorrelation(r),henceR2=(r)2rwillbecomputedshortlyandthisistrueformodelswithonly1indepenentvariable30CoefficientofDeterminationR2hasavalueof.6483.Thismeans64.83%ofthevariationintheauctionsellingprices(y)isexplainedbyyourregressionmodel.Theremaining35.17%isunexplained,i.e.duetoerror.Unlikethevalueofateststatistic,thecoefficientofdeterminationdoesnothaveacriticalvaluethatenablesustodrawconclusions.IngeneralthehigherthevalueofR2,thebetterthemodelfitsthedata.R2=1:Perfectmatchbetweenthelineandthedatapoints.R2=0:Therearenolinearrelationshipbetweenxandy.31RememberExcel’sOutput…Ananalysisofvariance(ANOVA)tableforthe
simplelinearregressionmodelcanbegiveby:SourcedegreesoffreedomSumsofSquaresMeanSquaresF-StatisticRegression1SSRMSR=SSR/1F=MSR/MSEErrorn–2SSEMSE=SSE/(n–2)Totaln–1Variation
iny(SST)32UsingtheRegressionEquation…Wecoulduseourregressionequation: y=17.250–.0669xtopredictthesellingpriceofacarwith40(40,000)milesonit: y=17.250–.0669x=17.250–.0669(40)=14,574Wecallthisvalue($14,574)apointprediction(estimate).Chancesarethoughtheactualsellingpricewillbedifferent,hencewecanestimatethesellingpriceintermsofaconfidence
interval.33PredictionIntervalThepredictionintervalisusedwhenwewanttopredictoneparticularvalueofthedependentvariable,givenaspecificvalueoftheindependentvariable:(xgisthegivenvalueofxwe’reinterestedin)34ConfidenceIntervalEstimatorforMeanofY…Theconfidenceintervalestimatefortheexpectedvalueofy(MeanofY)isusedwhenwewanttopredictanintervalweareprettysurecontainsthetrue“regressionline”.Inthiscase,weareestimatingthemeanofygivenavalueofx:(Technicallythisformulaisusedforinfinitelylargepopulations.However,wecaninterpretourproblemasattemptingtodeterminetheaveragesellingpriceofallFordTauruses,allwith40,000milesontheodometer)35What’stheDifference?PredictionIntervalConfidenceInterval1no1Usedtoestimatethevalueofonevalueofy(atgivenx)Usedtoestimatethemeanvalueofy(atgivenx)Theconfidenceintervalestimateoftheexpectedvalueofywillbenarrowerthanthepredictionintervalforthesamegivenvalueofxandconfidencelevel.Thisisbecausethereislesserrorinestimatingameanvalueasopposedtopredictinganindividualvalue.36RegressionDiagnostics…Therearethreeconditionsthatarerequiredinordertoperformaregressionanalysis.Theseare: •Theerrorvariablemustbenormallydistributed, •Theerrorvariablemusthaveaconstantvariance,& •Theerrorsmustbeindependentofeachother.Howcanwediagnoseviolationsoftheseconditions?ResidualAnalysis,thatis,examinethedifferencesbetweentheactualdatapointsandthosepredictedbythelinearequation…37Nonnormality…Wecantaketheresidualsandputthemintoahistogramtovisuallycheckfornormality……we’relookingforabellshapedhistogramwiththemeanclosetozero[ourold“testfornormality].38Heteroscedasticity…Whentherequirementofaconstantvarianceisviolated,wehaveaconditionofheteroscedasticity.Wecandiagnoseheteroscedasticitybyplottingtheresidualagainstthepredictedy.39Heteroscedasticity…Ifthevarianceoftheerrorvariable()isnotconstant,thenwehave“heteroscedasticity”.Here’stheplotoftheresidualagainstthepredictedvalueofy:theredoesn’tappeartobeachangeinthespreadoftheplottedpoints,thereforenoheteroscedasticity40NonindependenceoftheErrorVariableIfweweretoobservetheauctionpriceofcarseveryweekfor,say,ayear,thatwouldconstituteatimeseries.Whenthedataaretimeseries,theerrorsoftenarecorrelated.Errortermsthatarecorrelatedovertimearesaidtobeautocorrelatedorseriallycorrelated.Wecanoftendetectautocorrelationbygraphingtheresiduals
against
thetimeperiods.Ifapatternemerges,itislikelythattheindependencerequirementisviolated.41NonindependenceoftheErrorVariablePatternsintheappearanceoftheresidualsovertimeindicatesthatautocorrelationexists:Notetherunsofpositiveresiduals,replacedbyrunsofnegativeresidualsNotetheoscillatingbehavioroftheres
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026广东广州市天河区沙河街道公共文明引导员招募12人笔试备考试题及答案解析
- 2026年福建省莆田市事业单位人员招聘笔试试题与答案详解
- 2026年北京市朝阳区公务员人员招聘考试备考试题与答案详解
- 2027上海市第一妇婴保健院医师医技科研护理管理岗位招聘考试参考题库及答案解析
- 2026广西国控资本运营集团有限责任公司秋季公开招聘152人考试备考试题及答案解析
- 2026年汽车滚装码头行业洞察报告及未来五至十年发展趋势报告
- 海水淡化工程海水淡化工程海底管道铺设对底栖群落扰动恢复评估
- 2026年妇产科医院行业洞察报告及未来五至十年发展趋势报告
- 2026安徽安定医院芜湖医院(芜湖市第四人民医院)招聘劳务派遣人员23人(第三批)笔试备考试题及答案解析
- 2026年猪的饲养行业消费行为研究报告及未来五至十年降本增效与利润率修复
- 《股票价值评估用》课件
- 梗阻性肾病护理查房
- 2025年泰州市税务系统遴选面试真题带详解含答案
- 高岭土合作协议书
- 2021-2022学年天津市河东区高二上学期期中质量检测语文试题(解析版)
- 《思想道德与法治》课件-第四章 明确价值要求 践行价值准则
- 2026浙江省高校招生职业技能考试大纲(理论)-农艺类
- 住宅小区消防工程施工流程规划
- 2024中国近海生态分区
- 模塑聚苯板薄抹灰外保温技术与标准解析
- QC/T 1210-2024汽车防夹系统
评论
0/150
提交评论