欢迎来到天天文库
浏览记录
ID:40698267
大小:256.89 KB
页数:23页
时间:2019-08-06
《Regression analysis with STATA》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、RegressionanalysiswithSTATADrEiriniKonstantinidiLecturerinFinanceUniversityofExeter,BusinessSchoolXfiCentreofFinance&Investmente.konstantinidi@exeter.ac.uk1Outline•Multiplelinearregression.IsVIXaffectedbyS&P500returns&theslopeoftheyieldcurve?•ImportdataintoSTATA.
2、WorkingwithdatesinSTATA.•MultiplelinearregressionwithSTATA.EstimatingmultiplelinearregressionswithSTATA.UnderstandingtheSTATAoutput.Testingforautocorrelationintheresiduals:Durbin-Watsontest.Testingforheteroscedasticity:Breusch-Pagantest.2Multiplelinearregressio
3、n•Determinetheeffectofmorethanoneindependentvariablesonaparticulardependentvariable.Y=β+βX+βX+...+βX+εfori=1,2,...,ni011i22ikkiiwhereY:Dependentvariable.iX:Thej-thindependentvariable(j=1,2,...k).jiεErrorterm(i.e.portionofdependentvariablethaticannotbeexplainedbythe
4、independent).βSlopecoefficient.0βThej-thregressioncoefficient.j3Multiplelinearregression:Anexample•InvestigatetheeffectoftheS&P500index&theslopeoftheyieldcurveonVIX.VIXt=β0+β1Rt+β2YSt+εtwhereVIX:VIXindexmeasuredattimet.tR:ReturnontheS&P500attimet.tYS:Slopeoftheyiel
5、dcurve,calculatedasthetdifferencebetweenthe10Ygovernmentbondandthe1MT-billrateattimet.ε:Errorterm.t4ImportthedataintoSTATA•Dataset3containsdailydataontheVIXindex,S&P500returnsandslopeoftheyieldcurve(2/2/2001–13/2/2009).•Openthedataeditorbyclickingonthe‘DataEditor(E
6、dit)’iconontheSTATAtoolbar.•CopycellsA1:C3274in‘data3_VIX,SPXandYS.xlsx’.CellsA1,B1andC1containthenameofthevariables.•Pasteintothe‘DataEditor(Edit)’inSTATA.Treatfirstrowasvariablename.5WorkingwithdatesinSTATA:Convertingstringstodates•Datesarerecognisedas‘strings’
7、bySTATA.‘Strings’needtobeconvertedto‘dates’.•Thefollowingcommandsneedstobeused:date(string,mask,[,baseyear])cStringvariabletobetranslatedSpecifiestheorderofthecomponentsD:day,M:month,Y:yearUsedwhenwehavetwo-digityears:Statatochooseaprefixthatplacestheyearclosestto
8、baseyear6WorkingwithdatesinSTATA:Convertingstringstodates(Cont’d)•Typeonthecommandwindow:•Define‘dates_2’tobethetimevariablebytypinginthecommandw
此文档下载收益归作者所有