R语言处理面板数据--plm包

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

JSSJournalofStatisticalSoftwareJuly2008,Volume27,Issue2.:TheplmPackageYvesCroissantUniversiteLumiereLyon2GiovanniMilloUniversityofTriesteandGeneraliSpAAbstractPaneldataeconometricsisobviouslyoneofthemain eldsintheprofession,butmostofthemodelsusedarediculttoestimatewithR.plmisapackageforRwhichintendstomaketheestimationoflinearpanelmodelsstraightforward.plmprovidesfunctionstoestimateawidevarietyofmodelsandtomake(robust)inference.Keywords:paneldata,covariancematrixestimators,generalizedmethodofmoments,R.1.IntroductionPaneldataeconometricsisacontinuouslydeveloping eld.Theincreasingavailabilityofdataobservedoncross-sectionsofunits(likehouseholds, rms,countriesetc.)andovertimehasgivenrisetoanumberofestimationapproachesexploitingthisdoubledimensionalitytocopewithsomeofthetypicalproblemsassociatedwitheconomicdata, rstofallthatofunobservedheterogeneity.Timewiseobservationofdatafromdi erentobservationalunitshaslongbeencommoninother eldsofstatistics(wheretheyareoftentermedlongitudinaldata).Inthepaneldata eldaswellasinothers,theeconometricapproachisneverthelesspeculiarwithrespecttoexperimentalcontexts,asitisemphasizingmodelspeci cationandtestingandtacklinganumberofissuesarisingfromtheparticularstatisticalproblemsassociatedwitheconomicdata.Thus,whileaverycomprehensivesoftwareframeworkfor(amongmanyotherfeatures)max-imumlikelihoodestimationoflinearregressionmodelsforlongitudinaldata,packagesnlme(Pinheiro,Bates,DebRoy,andSarkar2007)andlme4(Bates2007),isavailableintheR(RDevelopmentCoreTeam2008)environmentandcanbeused,e.g.,forestimationofrandome ectspanelmodels,itsuseisnotintuitiveforapracticingeconometrician,andmaximumlikelihoodestimationisonlyoneofthepossibleapproachestopaneldataeconometrics.More-over,economicpaneldatasetsoftenhappentobeunbalanced(i.e.,theyhaveadi erentnumber2PanelDataEconometricsinR:TheplmPackageofobservationsbetweengroups),whichcaseneedssomeadaptationtothemethodsandisnotcompatiblewiththoseinnlme.Hencetheneedforapackagedoingpaneldata\fromtheeconometrician'sviewpointandfeaturingataminimumthebasictechniqueseconometri-ciansthemselvesareusedto:randomand xede ectsestimationofstaticlinearpaneldatamodels,variablecoecientsmodels,generalizedmethodofmomentsestimationofdynamicmodels;andthebasictoolboxofspeci cationandmisspeci cationdiagnostics.Furthermore,wefelttherewastheneedforautomationofsomebasicdatamanagementtasksaslagging,summingand,moreingeneral,applying(intheRsense)functionstothedata,which,althoughconceptuallysimple,becomecumbersomeanderror-proneontwo-dimensionaldata,especiallyinthecaseofunbalancedpanels.Theresultofourworkisbundledintheplmadd-onpackage,availablefromtheComprehensiveRArchiveNetworkat=plm.Thepaperisorganizedasfollows:Section2presentsaveryshortoverviewofthetypicalmodeltaxonomy1.Section3discussesthesoftwareapproachusedinthepackage.Thenextthreesectionspresentthefunctionalitiesofthepackageinmoredetail:datamanagement(Section4),estimation(Section5)andtesting(Section6),givingashortdescriptionandillustratingthemwithexamples.Section7comparestheapproachinplmtothatofnlmeandlme4,highlightingthefeaturesofthelattertwothataneconometricianmight ndmostuseful.Section8concludesthepaper.2.ThelinearpanelmodelThebasiclinearpanelmodelsusedineconometricscanbedescribedthroughsuitablerestric-tionsofthefollowinggeneralmodel:yit= it+ itxit+uit(1)wherei=1;:::nistheindividual(group,country,...)index,t=1;:::;Tisthetimeindexanduitarandomdisturbancetermofmean0.OfcoursethelatterisnotestimablewithN=nTdatapoints.Anumberofassumptionsareusuallymadeabouttheparameters,theerrorsandtheexogeneityoftheregressors,givingrisetoataxonomyoffeasiblemodelsforpaneldata.Themostcommononeisparameterhomogeneity,whichmeansthat it= foralli;tand it= foralli;t.Theresultingmodelyit= + xit+uit(2)isastandardlinearmodelpoolingallthedataacrossiandt.Tomodelindividualheterogeneity,oneoftenassumesthattheerrortermhastwoseparatecomponents,oneofwhichisspeci ctotheindividualanddoesnotchangeovertime2.Thisiscalledtheunobservede ectsmodel:1Comprehensivetreatmentsaretobefoundinmanyeconometricstextbooks,e.g.Baltagi(2001)orWooldridge(2002):thereaderisreferredtothese,especiallytothe rstninechaptersofBaltagi(2001).2Forthesakeofexpositionweareconsideringonlytheindividuale ectscasehere.Theremayalsobetimee ects,whichisasymmetriccase,orbothofthem,sothattheerrorhasthreecomponents:uit=i+t+it.JournalofStatisticalSoftware3yit= + xit+i+it(3)Theappropriateestimationmethodforthismodeldependsonthepropertiesofthetwoerrorcomponents.Theidiosyncraticerroritisusuallyassumedwell-behavedandindependentfromboththeregressorsxitandtheindividualerrorcomponenti.Theindividualcomponentmaybeinturneitherindependentfromtheregressorsorcorrelated.Ifitiscorrelated,theordinaryleastsquares(OLS)estimatorfor wouldbeinconsistent,soitiscustomarytotreattheiasafurthersetofnparameterstobeestimated,asifinthegeneralmodel it= iforallt.Thisiscalledthe xede ects(alsoknownaswithinorleastsquaresdummyvariables)model,usuallyes

1 / 43
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功