/
2regresspostestimationdiagnosticplots—Postestimationplotsforregre 2regresspostestimationdiagnosticplots—Postestimationplotsforregre

2regresspostestimationdiagnosticplots—Postestimationplotsforregre - PDF document

giovanna-bartolotta
giovanna-bartolotta . @giovanna-bartolotta
Follow
394 views
Uploaded On 2016-07-23

2regresspostestimationdiagnosticplots—Postestimationplotsforregre - PPT Presentation

MenuforrvfplotStatisticsLinearmodelsandrelatedRegressiondiagnosticsResidualversusttedplotDescriptionforrvfplotrvfplotgraphsaresidualversusttedplotagraphoftheresidualsagainstthettedvaluesOp ID: 415917

MenuforrvfplotStatisticsLinearmodelsandrelatedRegressiondiagnosticsResidual-versus-ttedplotDescriptionforrvfplotrvfplotgraphsaresidual-versus-ttedplot agraphoftheresidualsagainstthettedvalues.Op

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "2regresspostestimationdiagnosticplots..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

2regresspostestimationdiagnosticplots—Postestimationplotsforregress MenuforrvfplotStatistics�Linearmodelsandrelated�Regressiondiagnostics�Residual-versus-ttedplotDescriptionforrvfplotrvfplotgraphsaresidual-versus-ttedplot,agraphoftheresidualsagainstthettedvalues.Optionsforrvfplot  � Plot �marker optionsaffecttherenditionofmarkersdrawnattheplottedpoints,includingtheirshape,size,color,andoutline;see[G-3]marker options.marker label optionsspecifyifandhowthemarkersaretobelabeled;see[G-3]marker label options.  � Addplots �addplot(plot)providesawaytoaddplotstothegeneratedgraph.See[G-3]addplot option.  � Yaxis,Xaxis,Titles,Legend,Overall �twoway optionsareanyoftheoptionsdocumentedin[G-3]twoway options,excludingby().Theseincludeoptionsfortitlingthegraph(see[G-3]title options)andforsavingthegraphtodisk(see[G-3]saving option).Remarksandexamplesforrvfplotrvfplotgraphstheresidualsagainstthettedvalues. Example1Usingauto.dtadescribedin[U]1.2.2Exampledatasets,wewilluseregresstotamodelofpriceonweight,mpg,foreign,andtheinteractionofforeignwithmpg.Wespecifyforeign##c.mpgtoobtaintheinteractionofforeignwithmpg;see[U]11.4.3Factorvariables. regresspostestimationdiagnosticplots—Postestimationplotsforregress3 .usehttp://www.stata-press.com/data/r13/auto(1978AutomobileData).regresspriceweightforeign##c.mpgSource SSdfMSNumberofobs=74 F(4,69)=21.22Model 350319665487579916.3Prob�F=0.0000Residual 284745731694126749.72R-squared=0.5516 AdjR-squared=0.5256Total 635065396738699525.97RootMSE=2031.4 price Coef.Std.Err.t�P|t|[95%Conf.Interval] weight 4.613589.72549616.360.0003.1662636.060914 foreign Foreign 11240.332751.6814.080.0005750.87816729.78mpg 263.1875110.79612.380.02042.15527484.2197 foreign#c.mpg Foreign -307.2166108.5307-2.830.006-523.7294-90.70368 _cons -14449.584425.72-3.260.002-23278.65-5620.51 Oncewehavetamodel,wemayuseanyoftheregressiondiagnosticscommands.rvfplot(readresidual-versus-ttedplot)graphstheresidualsagainstthettedvalues:.rvfplot,yline(0) Allthediagnosticplotcommandsallowthegraphtwowayandgraphtwowayscatteroptions;wespeciedayline(0)todrawalineacrossthegraphaty=0;see[G-2]graphtwowayscatter.Inawell-ttedmodel,thereshouldbenopatterntotheresidualsplottedagainstthettedvalues—somethingnottrueofourmodel.Ignoringthetwooutliersatthetopcenterofthegraph,weseecurvatureinthepatternoftheresiduals,suggestingaviolationoftheassumptionthatpriceislinearinourindependentvariables.Wemightalsohaveseenincreasingordecreasingvariationintheresiduals—heteroskedasticity.Anypatternwhatsoeverindicatesaviolationoftheleast-squaresassumptions. 4regresspostestimationdiagnosticplots—Postestimationplotsforregress avplotSyntaxforavplotavplotindepvar,avplot optionsavplot optionsDescription Plotmarker optionschangelookofmarkers(color,size,etc.)marker label optionsaddmarkerlabels;changelookorpositionReferencelinerlop ts(cline options)affectrenditionofthereferencelineAddplotsaddplot(plot)addotherplotstothegeneratedgraphYaxis,Xaxis,Titles,Legend,Overalltwoway optionsanyoptionsotherthanby()documentedin[G-3]twoway options MenuforavplotStatistics�Linearmodelsandrelated�Regressiondiagnostics�Added-variableplotDescriptionforavplotavplotgraphsanadded-variableplot(a.k.a.partial-regressionleverageplot,partialregressionplot,oradjustedpartialresidualplot)afterregress.indepvarmaybeanindependentvariable(a.k.a.predictor,carrier,orcovariate)thatiscurrentlyinthemodelornot.Optionsforavplot  � Plot �marker optionsaffecttherenditionofmarkersdrawnattheplottedpoints,includingtheirshape,size,color,andoutline;see[G-3]marker options.marker label optionsspecifyifandhowthemarkersaretobelabeled;see[G-3]marker label options.  � Referenceline �rlopts(cline options)affectstherenditionofthereferenceline.See[G-3]cline options.  � Addplots �addplot(plot)providesawaytoaddotherplotstothegeneratedgraph.See[G-3]addplot option.  � Yaxis,Xaxis,Titles,Legend,Overall �twoway optionsareanyoftheoptionsdocumentedin[G-3]twoway options,excludingby().Theseincludeoptionsfortitlingthegraph(see[G-3]title options)andforsavingthegraphtodisk(see[G-3]saving option). regresspostestimationdiagnosticplots—Postestimationplotsforregress7 Descriptionforavplotsavplotsgraphsalltheadded-variableplotsinoneimage.Optionsforavplots  � Plot �marker optionsaffecttherenditionofmarkersdrawnattheplottedpoints,includingtheirshape,size,color,andoutline;see[G-3]marker options.marker label optionsspecifyifandhowthemarkersaretobelabeled;see[G-3]marker label options.combine optionsareanyoftheoptionsdocumentedin[G-2]graphcombine.Theseincludeoptionsfortitlingthegraph(see[G-3]title options)andforsavingthegraphtodisk(see[G-3]saving option).  � Referenceline �rlopts(cline options)affectstherenditionofthereferenceline.See[G-3]cline options.  � Yaxis,Xaxis,Titles,Legend,Overall �twoway optionsareanyoftheoptionsdocumentedin[G-3]twoway options,excludingby().Theseincludeoptionsfortitlingthegraph(see[G-3]title options)andforsavingthegraphtodisk(see[G-3]saving option).Remarksandexamplesforavplots Example3Inexample2,weusedavplottoexaminetheadded-variableplotformpginourregressionofpriceonweightandforeign##c.mpg.Nowlet'suseavplotstographanadded-variableplotforeveryregressorinthedata. 10regresspostestimationdiagnosticplots—Postestimationplotsforregress   � Options �lowessaddsalowesssmoothoftheplottedpointstoassistindetectingnonlinearities.lsopts(lowess options)affectstherenditionofthelowesssmooth.Foranexplanationoftheseoptions,especiallythebwidth()option,see[R]lowess.Specifyinglsopts()impliesthelowessoption.msplineaddsamediansplineoftheplottedpointstoassistindetectingnonlinearities.msopts(mspline options)affectstherenditionofthespline.Foranexplanationoftheseoptions,especiallythebands()option,see[G-2]graphtwowaymspline.Specifyingmsopts()impliesthemsplineoption.  � Addplots �addplot(plot)providesawaytoaddotherplotstothegeneratedgraph.See[G-3]addplot option.  � Yaxis,Xaxis,Titles,Legend,Overall �twoway optionsareanyoftheoptionsdocumentedin[G-3]twoway options,excludingby().Theseincludeoptionsfortitlingthegraph(see[G-3]title options)andforsavingthegraphtodisk(see[G-3]saving option).RemarksandexamplesforcprplotAdded-variableplotsaresuccessfulatidentifyingoutliers,buttheycannotbeusedtoidentifyfunctionalform.Thecomponent-plus-residualplot(Ezekiel1924;LarsenandMcCleary1972)isanotherattemptatprojectingmultidimensionaldataintoatwo-dimensionalform,butwithdifferentproperties.Althoughtheadded-variableplotcanidentifyoutliers,thecomponent-plus-residualplotcannot.Itcan,however,beusedtoexaminethefunctionalformassumptionsofthemodel.Bothplotshavethepropertythataregressionlinethroughthecoordinateshasaslopeequaltotheestimatedcoefcientintheregressionmodel. Example4Weillustratecomponent-plus-residualplotsusingavariationofauto.dta..usehttp://www.stata-press.com/data/r13/auto1(AutomobileModels).regresspricempgweightSource SSdfMSNumberofobs=74 F(2,71)=14.90Model 187716578293858289Prob�F=0.0000Residual 447348818716300687.58R-squared=0.2956 AdjR-squared=0.2757Total 635065396738699525.97RootMSE=2510.1 price Coef.Std.Err.t�P|t|[95%Conf.Interval] mpg -55.939375.24136-0.740.460-205.966394.08771weight 1.710992.58616822.920.005.54220632.879779_cons 2197.93190.7680.690.493-4164.3118560.11 14regresspostestimationdiagnosticplots—Postestimationplotsforregress .acprplotmpg,msplinemsopts(bands(13)) Itdoesdosomewhatbetter. rvpplotSyntaxforrvpplotrvpplotindepvar,rvpplot optionsrvpplot optionsDescription Plotmarker optionschangelookofmarkers(color,size,etc.)marker label optionsaddmarkerlabels;changelookorpositionAddplotsaddplot(plot)addotherplotstothegeneratedgraphYaxis,Xaxis,Titles,Legend,Overalltwoway optionsanyoptionsotherthanby()documentedin[G-3]twoway options MenuforrvpplotStatistics�Linearmodelsandrelated�Regressiondiagnostics�Residual-versus-predictorplot regresspostestimationdiagnosticplots—Postestimationplotsforregress17 Remarksandexamplesforlvr2plotOneofthemostusefuldiagnosticgraphsisprovidedbylvr2plot(leverage-versus-residual-squaredplot),agraphofleverageagainstthe(normalized)residualssquared. Example7Weillustratelvr2plotusingourmodelinexample1..usehttp://www.stata-press.com/data/r13/auto(1978AutomobileData).regresspriceweightforeign##c.mpg(outputomitted).lvr2plot Thelinesonthechartshowtheaveragevaluesofleverageandthe(normalized)residualssquared.Pointsabovethehorizontallinehavehigher-than-averageleverage;pointstotherightoftheverticallinehavelarger-than-averageresiduals.Onepointimmediatelycatchesoureye,andfourmoremakeuspause.Thepointatthetopofthegraphhashighleverageandasmaller-than-averageresidual.Theotherpointsthatbotherusallhavehigher-than-averageleverage,twowithsmaller-than-averageresidualsandtwowithlarger-than-averageresiduals.Alessprettybutmoreusefulversionoftheabovegraphspeciesthatmakebeusedasthesymbol(see[G-3]marker label options): regresspostestimationdiagnosticplots—Postestimationplotsforregress19 .2010b.Modeltassessmentviamarginalmodelplots.StataJournal10:215–225.Mallows,C.L.1986.Augmentedpartialresiduals.Technometrics28:313–319.Mosteller,C.F.,andJ.W.Tukey.1977.DataAnalysisandRegression:ASecondCourseinStatistics.Reading,MA:Addison–Wesley.Welsch,R.E.1986.Comment[onChatterjeeandHadi1986].StatisticalScience1:403–405.Alsosee[R]regress—Linearregression[R]regresspostestimation—Postestimationtoolsforregress[R]regresspostestimationtimeseries—Postestimationtoolsforregresswithtimeseries[U]20Estimationandpostestimationcommands

Related Contents


Next Show more