logo资料库

Stata面板门槛回归-南开大学王群勇.pdf

第1页 / 共15页
第2页 / 共15页
第3页 / 共15页
第4页 / 共15页
第5页 / 共15页
第6页 / 共15页
第7页 / 共15页
第8页 / 共15页
资料共15页,剩余部分请下载后查看
TheStataJournal(2015)15,Number1,pp.121–134Fixed-effectpanelthresholdmodelusingStataQunyongWangInstituteofStatisticsandEconometricsNankaiUniversityTianjin,ChinaQunyongWang@outlook.comAbstract.Thresholdmodelsarewidelyusedinmacroeconomicsandfinancialanalysisfortheirsimpleandobviouseconomicimplications.Withthesemodels,however,estimationandinferenceiscomplicatedbytheexistenceofnuisanceparameters.Tocombatthisissue,Hansen(1999,JournalofEconometrics93:345–368)proposedthefixed-effectpanelthresholdmodel.Inthisarticle,Iintroduceanewcommand(xthreg)forimplementingthismodel.IalsouseMonteCarlosimulationstoshowthat,althoughthesizedistortionofthethreshold-effecttestissmall,thecoveragerateoftheconfidenceintervalestimatorisunsatisfactory.Iincludeanexampleonfinancialconstraints(originallyfromHansen[1999,JournalofEconometrics93:345–368])tofurtherdemonstratetheuseofxthreg.Keywords:st0373,xthreg,panelthreshold,fixedeffect1IntroductionHeterogeneityisacommonproblemofpaneldata.Thatistosay,eachindividualinastudyisdifferent,andstructuralrelationshipsmayvaryacrossindividuals.Theclassicalfixedeffectorrandomeffectreflectsonlytheheterogeneityinintercepts.Hsiao(2003)considersmanyvaryingslopemodelsforthisproblem.Amongthesemodels,Hansen’s(1999)panelthresholdmodelhasasimplespecificationbutobviousimplicationsforeconomicpolicy.Thoughthresholdmodelsarefamiliarintime-seriesanalysis,theirusewithpaneldatahasbeenlimited.Thethresholdmodeldescribesthejumpingcharacterorstructuralbreakinthere-lationshipbetweenvariables.Thismodeltypeispopularinnonlineartimeseries,oneexamplebeingthethresholdautoregressive(TAR)model(Tong1983).Thismodelcancapturemanyeconomicphenomena.Forexample,usingfive-yearintervalaveragesofstandardmeasuresoffinancialdevelopment,inflation,andgrowthfor84countriesfrom1960to1995,RousseauandWachtel(2009)showedthatthereisaninflationthresh-oldforthefinanceandgrowthrelationshipthatliesbetween13–25%.Wheninflationexceedsthethreshold,financeceasestoincreaseeconomicgrowth.Inflation’seffectoneconomicgrowthdependsontheinflationlevel.Highlevelsofinflationareharmfultoeconomicgrowth,whilelowlevelsofinflationarebeneficialtoeconomicgrowth.Asan-otherexample,thetechnicalspilloverofforeigndirectinvestment(FDI)hasbeenwidelystudied.Girma(2005)foundthattheproductivitybenefitfromFDIincreaseswithab-sorptivecapacityuntilsomethresholdlevel,atwhichpointitbecomeslesspronounced.ThereisalsoaminimumabsorptivecapacitythresholdlevelbelowwhichproductivityspilloversfromFDIarenegligibleorevennegative.c2015StataCorpLPst0373
122Fixed-effectpanelthresholdmodelusingStataThisarticleisarrangedasfollows.Insection2,Ireviewsomebasictheoriesaboutfixed-effectpanelthresholdmodels.Ithendescribethenewxthregcommandinsec-tion3.Insection4,IperformMonteCarlosimulationstostudytest-powerdistortionandthecoveragerateofconfidenceintervalestimatorsinfinitesamples.IillustrateuseofthecommandwithanexamplefromHansen(1999)insection5.Insection6,Iconcludethearticle.2Fixed-effectpanelthresholdmodels2.1Single-thresholdmodelConsiderthefollowingsingle-thresholdmodel:yit=μ+Xit(qit<γ)β1+Xit(qit≥γ)β2+ui+eit(1)Thevariableqitisthethresholdvariable,andγisthethresholdparameterthatdividestheequationintotworegimeswithcoefficientsβ1andβ2.Theparameteruiistheindividualeffect,whileeitisthedisturbance.Wecanalsowrite(1)asyit=μ+Xit(qit,γ)β+ui+eitwhereXit(qit,γ)=XitI(qit<γ)XitI(qit≥γ)Givenγ,theordinaryleast-squaresestimatorofβisβ={X∗(γ)X∗(γ)}−1{X∗(γ)y∗}wherey∗andX∗arewithin-groupdeviations.Theresidualsumofsquares(RSS)isequaltoe∗e∗.Toestimateγ,onecansearchoverasubsetofthethresholdvariableqit.Insteadofsearchingoverthewholesample,werestricttherangewithintheinterval(γ,γ),whicharequantilesofqit.γ’sestimatoristhevaluethatminimizestheRSS,thatis,γ=argminγS1(γ)Ifγisknown,themodelisnodifferentfromtheordinarylinearmodel.Butifγisunknown,thereisanuisanceparameterproblem,whichmakestheγestimator’sdistributionnonstandard.Hansen(1999)provedthatγisaconsistentestimatorforγ,andhearguedthatthebestwaytotestγ=γ0istoformtheconfidenceintervalusingthe“no-rejectionregion”methodwithalikelihood-ratio(LR)statistic,asfollows:LR1(γ)={LR1(γ)−LR1(γ)}σ2Pr−−→ξPr(x<ξ)=(1−e−x2)2(2)
Q.Wang123Givensignificancelevelα,thelowerlimitcorrespondstothemaximumvalueintheLRseries,whichislessthantheαquantile,andtheupperlimitcorrespondstotheminimumvalueintheLRseries,whichislessthantheαquantile.Theαquantilecanbecomputedfromthefollowinginversefunctionof(2):c(α)=−2log1−√1−αForexample,forα=0.1,0.05,and0.01,thequantilesare6.53,7.35,and10.59,respec-tively.IfLR1(γ0)exceedsc(α),thenwerejectH0.Testingforathresholdeffectisthesameastestingforwhetherthecoefficientsarethesameineachregime.Thenullhypothesisandthealternativehypothesis(thelinearversusthesingle-thresholdmodel)areH0:β1=β2Ha:β1=β2TheFstatisticisconstructedasF1=S0−S1σ2(3)UnderH0,thethresholdγisnotidentified,andF1hasnonstandardasymptoticdistribution.WeusebootstraponthecriticalvaluesoftheFstatistictotestthesignificanceofthethresholdeffect.S0istheRSSofthelinearmodel.Hansen(1996)suggestedthefollowingbootstrapdesign:Step1:FitthemodelunderHaandobtaintheresiduale∗it.Step2:Makeaclusterresamplinge∗itwithreplacement,andobtainthenewresidualv∗it.Step3:GenerateanewseriesundertheHadata-generatingprocess(DGP),y∗it=X∗itβ+v∗it,whereβcantakearbitraryvalues.Step4:FitthemodelunderH0andHa,andcomputetheFstatisticusing(3).Step5:Repeatsteps1–4Btimes,andtheprobabilityofFisPr=I(F>F1),namely,theproportionofF>F1inbootstrapnumberB.2.2Multiple-thresholdsmodelIftherearemultiplethresholds(thatis,multipleregimes),wefitthemodelsequentially.Weuseadouble-thresholdmodelasanexample.yit=μ+Xit(qit<γ1)β1+Xit(γ1≤qit<γ2)β2+Xit(qit≥γ2)β3+ui+eitHere,γ1andγ2arethethresholdsthatdividetheequationintothreeregimeswithcoefficientsβ1,β2,andβ3.Weneedtocomputethis(N×T)2timesusingthegridsearchmethod,whichisinfeasibleinpractice.AccordingtoBai(1997)andBaiandPerron(1998),thesequentialestimatorisconsistent,soweestimatethethresholdsasfollows:
124Fixed-effectpanelthresholdmodelusingStataStep1:Fitthesingle-thresholdmodeltoobtainthethresholdestimatorγ1andtheRSSS1(γ1).Step2:Givenγ1,thesecondthresholdanditsconfidenceintervalareγr2=argminγ2{Sr2(γ2)}Sr2=S{min(γ1,γ2)max(γ1,γ2)}LRr2(γ2)={Sr2(γ2)−Sr2(γr2)}σ222Step3:γr2isefficientbutγr1isnot.Wereestimatethefirstthresholdasγr1=argminγ1{Sr1(γ1)}Sr1=S{min(γ1,γ2)max(γ1,γ2)}LRr1(γ1)={Sr1(γ1)−Sr1(γr1)}σ221Thethreshold-effecttestisalsosequential;thatis,ifwerejectthenullhypothesisinasingle-thresholdmodel,thenwemusttestthedouble-thresholdmodel.Thenullhy-pothesisisasingle-thresholdmodel,andthealternativehypothesisisadouble-thresholdmodel.TheFstatisticisconstructedasF2={S1(γ1)−Sr2(γr2)}σ222(4)Thebootstrappingdesignforthisissimilartothatinthesingle-thresholdmodel.Instep3,wegenerateanewseriesundertheH0DGP,y∗it=X∗itβS+v∗it.TheestimatorβSistheestimatorinasingle-thresholdmodel,thatis,undertheHaDGP.Weusethepredictedvalues.Formodelswithmorethantwothresholdparameters,theprocessissimilar.Chan(1993)andHansen(1999)showthatthedependenceoftheestimationandinferenceofβonthethresholdestimateisnotoffirst-orderasymptoticimportance,sotheinferenceofβcanproceedbecauseγisgiven.
Q.Wang1253Thexthregcommand3.1Syntaxxthregdepvarindepvarsifin,rx(varlist)qx(varname)thnum(#)grid(#)trim(numlist)bs(numlist)thlevel(#)gen(newvarname)noregnobslogthgivenoptionswheredepvaristhedependentvariableandindepvarsaretheregime-independentvari-ables.3.2Optionsrx(varlist)istheregime-dependentvariable.Time-seriesoperatorsareallowed.rx()isrequired.qx(varname)isthethresholdvariable.Time-seriesoperatorsareallowed.qx()isrequired.thnum(#)isthenumberofthresholds.Inthecurrentversion(Stata13),#mustbeequaltoorlessthan3.Thedefaultisthnum(1).grid(#)isthenumberofgridpoints.grid()isusedtoavoidconsumingtoomuchtimewhencomputinglargesamples.Thedefaultisgrid(300).trim(numlist)isthetrimmingproportiontoestimateeachthreshold.Thenumberoftrimmingproportionsmustbeequaltothenumberofthresholdsspecifiedinthnum().Thedefaultistrim(0.01)forallthresholds.Forexample,tofitatriple-thresholdmodel,youmaysettrim(0.010.010.05).bs(numlist)isthenumberofbootstrapreplications.Ifbs()isnotset,xthregdoesnotusebootstrapforthethreshold-effecttest.thlevel(#)specifiestheconfidencelevel,asapercentage,forconfidenceintervalsofthethreshold.Thedefaultisthlevel(95).gen(newvarname)generatesanewcategoricalvariablewith0,1,2,...foreachregime.Thedefaultisgen(cat).noregsuppressesthedisplayoftheregressionresult.nobslogsuppressestheiterationprocessofthebootstrap.thgivenfitsthemodelbasedonpreviousresults.optionsareanyoptionsavailableforxtreg(see[XT]xtreg).Time-seriesoperatorsareallowedindepvar,indepvars,rx(),andqx().
126Fixed-effectpanelthresholdmodelusingStata3.3Storedresultsxthregusesxtreg(see[XT]xtreg)tofitthefixed-effectpanelthresholdmodelgiventhethresholdestimator.Alongwiththestandardstoredresultsfromxtreg,xthregalsostoresthefollowingresultsine():Scalarse(thnum)numberofthresholdse(grid)numberofgridsearchpointsMacrose(depvar)nameofdependentvariablee(ix)regime-independentvariablese(rx)regime-dependentvariablese(qx)thresholdvariableMatricese(Thrss)thresholdestimatorandconfidenceintervale(Fstat)threshold-effecttestresulte(bs)bootstrapnumbere(trim)trimmingproportione(LR)LRstatisticsforsingle-thresholdmodele(LR21)LRstatisticsforfirstthresholdindouble-thresholdmodele(LR22)LRstatisticsforsecondthresholdindouble-thresholdmodele(LR3)LRstatisticsforthirdthresholdintriple-thresholdmodelThefixed-effectpanelthresholdmodelrequiresbalancedpaneldata,whichischeckedautomaticallybyxthreg.TheestimationandtestofthethresholdeffectarecomputedinMata.Youcanfitthemodelwithmorethresholdsusingthepreviousresult.Forexample,assumeyouusexthregtofitasingle-thresholdmodelbyusingthnum(1),butthesinglethresholdisnotsufficienttocapturethenonlineareffect.Tonowfitadouble-thresholdmodel,youcanrunthexthregcommandusingthgiven.Statawillsearchthesecondthresholdusingthepreviousresultandwillnotfitthesingle-thresholdmodel.Iillustratethisintheexamplebelow.4MonteCarlosimulationxthregimplementsthemethodbyHansen(1999),inwhichthebootstrapmethodisusedtotestthenullhypothesisofnothreshold.Underthenull,thedistributioniscontinuous,sothebootstrapmethodcanbeapplied.However,thereisnoformaljustificationforusingthebootstraptestwithamultiple-thresholdmodel.Moreover,ifbootstrapisusedtocreateconfidenceintervalsforthethresholdmodel,thentheremaybeaproblem.Enders,Falk,andSiklos(2007)comparedthefinite-sampleperformanceofthefol-lowingthreemethodsinTAR:invertingtheLRstatisticusingtheasymptoticcriticalvalues,usingthebootstrappeddistributionoftheLRtodeterminethecriticalvalues,andusingthebootstrappercentilemethod.Theyfoundthatnoneofthethreemeth-odsperformssatisfactorilyforthediscontinuous-TARmodel.Allthreemethodsaretooconservative,creatingconfidenceintervalsthataretoowide.Ofthemethods,thebootstrappedLRmethodperformstheworst.
Q.Wang127However,newbootstrapmethodsfortheTARmodelhaverecentlybeenintroduced.GonzaloandWolf(2005)proposedtouseasubsamplingmethod—likethatintroducedbyPolitis,Romano,andWolf(1999)—toimprovethefinite-sampleperformanceofthethresholdestimatorintheself-excitingTARmodel.AndrewsandGuggenberger(2009)thenintroducedahybridsubsamplingmethodandsize-correctedmethodsofconstruct-ingtestsandconfidenceintervalsthathavecorrectasymptoticsize.However,literatureconcerningthepanelthresholdmodelisstillverylimited,andthereisstillnotheoret-icaldevelopmentforovercomingwideconfidenceintervals.FollowingHansen(1999),IinverttheLRstatistictoconstructtheconfidenceintervalofthethresholdestimator.Hansen(1999)didnotperformMonteCarlosimulationstostudythecoveragerateforthismethod.Inthissection,Iperformsimulationstostudythesizeofthethreshold-effecttestandthecoveragerateofthethresholdestimator.Fortherealsignificancelevelofthethreshold-effecttest,theDGPforthenullhypothesis(withoutthethresholdeffect)issimplyalinearregressionmodel,thatis,yit=1+zit+xit+ui+eitThevariablesaregeneratedaccordingtozit,xit∼χ2(1),ui∼χ2(1)−1,andeit∼N(0,1),wherezisregimeindependentandxisregimedependent.Thealternativehypothesisisthatthecoefficientofxisregimedependentonsomethresholdvariableq.Wesetn=50,100,200,500andT=5,20,50.Thebootstrapiterationnumberissetto300forthissingle-thresholdmodel.TheiterationnumberofMonteCarlosimulationissetto500.Thesimulationistimeconsumingbecausebootstrapisusedtotestthethresholdeffectforeachsimulation.OnacomputerwithInterCorei7,2.22GHzprocessor,and8GBRAM,thesimulationtakesabout26hours.Table1liststheresult.Thetestsizedistortionissmall,evenforsmallnandT.However,thereisnocon-vergenceofthebiaswithincreasingsamplesizes.AsHansen(1997)noted,“theboot-strapprocedureattainsthefirst-orderasymptoticdistribution,sop-valuesconstructedfromthebootstrapareasymptoticallyvalid.Becausetheasymptoticdistributionisnonpivotal,bootstrapsizewillnothaveanacceleratedrateofconvergencerelativetoconventionalasymptoticapproximations.”
128Fixed-effectpanelthresholdmodelusingStataTable1.Simulationresultofthesizeofthethreshold-effecttestnT1%5%10%5050.0100.0640.11810050.0240.0620.11420050.0220.0580.09450050.0080.0480.10650200.0120.0500.108100200.0160.0460.090200200.0080.0400.098500200.0140.0580.12250500.0140.0580.108100500.0120.0440.114200500.0100.0480.102500500.0140.0560.122ThefollowingDGPisusedtosimulatethecoverageratewhereqit∼χ2(1):yit=1+zit+xit(qit<1)+2xit(qit≥1)+ui+eitTheiterationnumberofMonteCarlosimulationissetto500.Theresultisgivenintable2.Table2.SimulationresultofthecoverageratenTRMSERatenTRMSERatenTRMSERate5050.01030.46050200.000400.80850500.000100.95210050.00260.636100200.000050.920100500.000050.99420050.00050.768200200.000030.988200500.000031.00050050.00010.948500200.000010.998500500.000021.000Obviously,therootofthemeansquarederrordecreaseswithlargernorlargerT.Figure1isthekerneldensityplotoftheestimatorsforn=50,100,200,500andT=5,whichdemonstratestheconsistencyoftheestimator.Becauseoftheconsistencyofthethresholdestimator,theestimatorsoftheregressioncoefficientgiventhethresholdareconsistentwiththeordinarylinearfixed-effectmodel.However,asnorTincreases,theconfidenceintervalgetswiderandthecoveragerateofthethresholdestimatorgetsbiggerthanthenominallevel.ThismeansthattheconfidenceintervalgetstoowideforlargenandT,becausetheinverseLRmethodisnotaveryefficientmethodforconstructingconfidenceintervals.Aspreviouslydiscussed,thisproblemisnotspecifictothepanelthresholdmodel;itiscommontoalmostallthresholdmodels.Insum,theinverseLRmethoddoesnotperformthatwellforsmallsamplesizes,andmoreresearchisneededtoimprovethecoveragerateforthepanelthresholdmodel.
分享到:
收藏