Chapter17. Robustcovariancematrixestimation
150
Despitethepointsmadeabove,someresidualdegreeofheteroskedasticitymaybepresentintime
seriesdata: thekeypointisthatinmostcasesitislikelytobecombinedwithserialcorrelation
(autocorrelation), hencedemanding g aspecialtreatment. . In n White’s approach,
ˆ
Ú, theestimated
covariancematrixoftheu
t
, remains convenientlydiagonal: : thevariances, Eu
2
t
, maydiffer by
but thecovariances, Eu
t
u
s
, are e allzero. . Autocorrelation n in timeseries data means that at
leastsomeofthetheoff-diagonalelementsof
ˆ
Úshouldbenon-zero.Thisintroducesasubstantial
complicationandrequires anotherpieceofterminology; estimates of thecovariancematrixthat
areasymptoticallyvalidinfaceofbothheteroskedasticityandautocorrelationoftheerrorprocess
aretermedHAC(heteroskedasticityandautocorrelationconsistent).
Theissue of HAC estimation is s treated in more e technical terms s in chapter 22. Here e we try to
conveysomeoftheintuitionat amorebasiclevel. . Webeginwithageneral l comment: : residual
autocorrelationisnotsomuchapropertyofthedata,asasymptomofaninadequatemodel.Data
maybepersistentthoughtime,andifwefitamodelthatdoesnottakethisaspectintoaccount
properly,weendupwithamodelwithautocorrelateddisturbances.Conversely,itisoftenpossible
tomitigateoreveneliminatetheproblemofautocorrelationbyincludingrelevantlaggedvariables
inatimeseriesmodel,orinotherwords,byspecifyingthedynamicsofthemodelmorefully.HAC
estimationshouldnot beseenasthefirstresortindealingwithanautocorrelatederrorprocess.
Thatsaid, the“obvious”extensionofWhite’s HCCMEto thecaseof autocorrelatederrors would
seem tobethis: : estimatetheoff-diagonalelements s of
ˆ
Ú (thatis, theautocovariances, Eu
t
u
s
)
using,onceagain,theappropriateOLSresiduals:!ˆ
ts
ˆu
t
ˆu
s
. Thisisbasicallyright,butdemands
animportantamendment. Weseekaconsistentestimator,onethatconvergestowardsthetrueÚ
as thesamplesizetendstowards infinity. . This s can’twork ifweallow unboundedserialdepen-
dence. Biggersampleswillenableustoestimatemoreofthetrue!
ts
elements(thatis,fortand
smorewidelyseparatedintime)butwillnotcontributeever-increasinginformationregardingthe
maximallyseparated !
ts
pairs, since e the maximalseparation itself grows s withthesamplesize.
Toensureconsistency,wehavetoconfineourattentiontoprocessesexhibitingtemporallylimited
dependence,orinotherwordscutoffthecomputationofthe!ˆ
ts
valuesatsomemaximumvalue
ofpt s(wherepistreatedasanincreasingfunctionofthesamplesize,T,althoughitcannot
increaseinproportiontoT).
Thesimplestvariantofthisideaisto truncatethecomputationatsomefinitelagorderp,where
pgrowsas,say,T1=4. Thetroublewiththisisthattheresulting
ˆ
Úmaynotbeapositivedefinite
matrix. Inpracticalterms,wemayendupwithnegativeestimatedvariances. Onesolutiontothis
problemisofferedbyTheNewey–Westestimator(NeweyandWest,1987),whichassignsdeclining
weightstothesampleautocovariancesasthetemporalseparationincreases.
Tounderstandthispointitishelpfultolookmorecloselyatthecovariancematrixgivenin(17.5),
namely,
X
0
X
1
X
0ˆ
ÚXX
0
X
1
This isknownas a“sandwich” ” estimator. . Thebread, , which appears on bothsides, is X0X 1.
Thisisakkmatrix,andisalsothekeyingredientinthecomputationoftheclassicalcovariance
matrix.Thefillinginthesandwichis
ˆ
Ö
X
0
ˆ
Ú
X
kk
kT
TT
Tk
SinceÚEuu
0
,thematrixbeingestimatedherecanalsobewrittenas
ÖEX
0
uu
0
X
whichexpressesÖasthelong-runcovarianceoftherandomk-vectorX
0
u.
Fromacomputationalpointofview,itisnotnecessaryor desirabletostorethe(potentiallyvery
large)Tmatrix
ˆ
Úassuch.Rather,onecomputesthesandwichfillingbysummationas
ˆ
Ö
ˆ
0
p
X
j1
w
j
ˆ
j
ˆ
0
j
Convert pdf file to jpg file - Convert PDF to JPEG images in C#.net, ASP.NET MVC, WinForms, WPF project
How to convert PDF to JPEG using C#.NET PDF to JPEG conversion / converter library control SDK
.pdf to .jpg converter online; c# pdf to jpg
Convert pdf file to jpg file - VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.net, ASP.NET MVC, WinForms, WPF project
Online Tutorial for PDF to JPEG (JPG) Conversion in VB.NET Image Application
change pdf file to jpg online; convert multiple pdf to jpg
Chapter17. Robustcovariancematrixestimation
151
wherethekksampleautocovariancematrix
ˆ
j,forj0,isgivenby
ˆ
j
1
T
XT
tj1
ˆu
t
ˆu
t j
X
0
t
X
t j
andw
j
istheweightgiventotheautocovarianceatlagj>0.
Thisleavestwoquestions. Howexactlydowedeterminethemaximumlaglengthor“bandwidth”,
p,oftheHACestimator? Andhowexactlyaretheweightsw
j
tobedetermined?Wewillreturnto
the(difficult)questionofthebandwidthshortly.Asregardstheweights,gretloffersthreevariants.
ThedefaultistheBartlettkernel,asusedbyNeweyandWest.Thissets
w
j
8
<
:
j
p1
jp
0
j>p
sotheweightsdeclinelinearlyasjincreases. TheothertwooptionsaretheParzenkernelandthe
QuadraticSpectral(QS)kernel.FortheParzenkernel,
w
j
8
>
>
<
>
>
:
1 6a
2
j
6a
3
j
0a
j
0:5
2a
j
3
0:5<a
j
1
0
a
j
>1
wherea
j
j=p1,andfortheQSkernel,
w
j
25
122d
2
j
sinm
j
m
j
cosm
j
!
whered
j
j=pandm
j
6d
i
=5.
Figure17.1showstheweightsgeneratedbythesekernels,forp4andj=1to9.
Figure17.1:ThreeHACkernels
Bartlett
Parzen
QS
Ingretlyouselectthekernelusingthesetcommandwiththehac_kernelparameter:
set hac_kernel parzen
set hac_kernel qs
set hac_kernel bartlett
SelectingtheHACbandwidth
Theasymptotic theorydevelopedby Newey, , Westand d others tells us ingeneral terms how the
HACbandwidth, p, shouldgrow withthesamplesize, T—thatis, pshould growinproportion
tosomefractionalpowerofT. Unfortunatelythisisoflittlehelpto o theappliedeconometrician,
workingwithagivendatasetoffixedsize. Variousrulesofthumbhavebeensuggested,andgretl
implementstwosuch. Thedefaultisp0:75T1=3,asrecommendedbyStockandWatson(2003).
Analternativeis p 4T=1002=9, asinWooldridge(2002b). . Ineachcaseonetakes s theinteger
partoftheresult. Thesevariantsarelabelednw1andnw2respectively, , inthecontextoftheset
commandwiththehac_lagparameter. Thatis,youcanswitchtotheversiongivenbyWooldridge
with
Online Convert Jpeg to PDF file. Best free online export Jpg image
Convert a JPG to PDF. You can drag and drop your JPG file in the box, and then start immediately to sort the files, try out some settings and then create the
change pdf to jpg image; changing pdf file to jpg
Online Convert PDF to Jpeg images. Best free online PDF JPEG
Online PDF to JPEG Converter. Download Free Trial. Convert a PDF File to JPG. Drag and drop your PDF in the box above and we'll convert the files for you.
convert pdf picture to jpg; convert pdf file to jpg online
Chapter17. Robustcovariancematrixestimation
152
set hac_lag nw2
AsshowninTable17.1thechoicebetweennw1andnw2doesnotmakeagreatdealofdifference.
T
p(nw1) p(nw2)
50
2
3
100
3
4
150
3
4
200
4
4
300
5
5
400
5
5
Table17.1:HACbandwidth:tworulesofthumb
Youalsohavetheoptionofspecifyingafixednumericalvalueforp,asin
set hac_lag 6
InadditionyoucansetadistinctbandwidthforusewiththeQuadraticSpectralkernel(sincethis
neednotbeaninteger).Forexample,
set qs_bandwidth 3.5
Prewhiteninganddata-basedbandwidthselection
Analternativeapproachistodealwithresidualautocorrelationbyattackingtheproblemfromtwo
sides. The e intuitionbehind thetechniqueknown as VARprewhitening (Andrews and Monahan,
1992)canbeillustratedbyasimpleexample. Letx
t
beasequenceoffirst-order autocorrelated
randomvariables
x
t
x
1
u
t
Thelong-runvarianceofx
t
canbeshowntobe
V
LR
x
t
V
LR
u
t
2
Inmostcases,u
t
islikelytobelessautocorrelatedthanx
t
,soasmallerbandwidthshouldsuffice.
EstimationofV
LR
x
t
canthereforeproceedinthreesteps:(1)estimate;(2)obtainaHACestimate
of ˆu
t
x
t
ˆx
1
;and(3)dividetheresultby
2
.
Theapplicationoftheaboveconcepttoourproblemimpliesestimatingafinite-orderVectorAu-
toregression(VAR)onthevectorvariables
t
X
t
ˆ
u
t
. Ingeneral,theVARcanbeofanyorder,but
inmostcases1issufficient;theaimisnottobuildawatertightmodelfor
t
,butjustto“mopup”
asubstantialpartoftheautocorrelation.Hence,thefollowingVARisestimated
t
A
1
"
t
ThenanestimateofthematrixX
0
ÚXcanberecoveredvia
I
ˆ
A
1ˆ
Ö
"
I
ˆ
A
0
1
where
ˆ
Ö
"
isanyHACestimator,appliedtotheVARresiduals.
Youcanaskforprewhiteningingretlusing
set hac_prewhiten on
VB.NET PDF File Merge Library: Merge, append PDF files in vb.net
VB.NET Components to combine various scanned images to PDF, such as tiff, jpg, png, gif, bmp, etc. Append one PDF file to the end of another one in VB.NET.
convert pdf to jpg converter; convert pdf to jpg
C# PDF File Merge Library: Merge, append PDF files in C#.net, ASP.
scanned images to PDF, such as tiff, jpg, png, gif, bmp, etc. Merge Microsoft Office Word, Excel and PowerPoint data to PDF form. Append one PDF file to the end
c# convert pdf to jpg; change pdf to jpg on
Chapter17. Robustcovariancematrixestimation
153
Thereisatpresentnomechanismforspecifyinganorderotherthan1fortheinitialVAR.
Afurtherrefinementisavailableinthiscontext,namelydata-basedbandwidthselection. Itmakes
intuitivesensethattheHAC bandwidth shouldnot simplybebasedon thesizeof thesample,
butshouldsomehowtakeintoaccountthetime-seriespropertiesofthedata(andalsothekernel
chosen). AnonparametricmethodfordoingthiswasproposedbyNeweyandWest(1994);agood
conciseaccountofthemethodisgiveninHall(2005).Thisoptioncanbeinvokedingretlvia
set hac_lag nw3
Thisoptionisthedefaultwhenprewhiteningisselected,butyoucanoverrideitbygivingaspecific
numericalvalueforhac_lag.
EventheNewey–Westdata-basedmethoddoesnotfullypindownthebandwidthforanyparticular
sample.Thefirststepinvolvescalculatingaseriesofresidualcovariances.Thelengthofthisseries
isgivenasafunctionofthesamplesize,butonlyuptoascalarmultiple—forexample,itisgiven
asOT
2=9
fortheBartlettkernel.Gretlusesanimpliedmultipleof1.
VARs:aspecialcase
Awell-specifiedvector autoregression(VAR)willgenerallyincludeenoughlagsofthedependent
variables to obviate the problem of residual autocorrelation, , in n which case e HAC C estimation n is
redundant—although theremay still be a need to correct for heteroskedasticity. . For r that rea-
sonplainHCCME,andnotHAC,isthedefaultwhenthe--robustflagisgiveninthecontextofthe
varcommand. However,ifforsomereasonyouneedHACyoucanforcetheissuebygivingthe
option--robust-hac.
17.4 Specialissueswithpaneldata
Sincepaneldatahavebothatime-seriesandacross-sectionaldimensiononemightexpectthat,in
general,robustestimationofthecovariancematrixwouldrequirehandlingbothheteroskedasticity
andautocorrelation(theHACapproach). Inaddition,somespecialfeaturesofpaneldatarequire
attention.
 Thevarianceoftheerrortermmaydifferacrossthecross-sectionalunits.
 Thecovarianceoftheerrorsacrosstheunitsmaybenon-zeroineachtimeperiod.
 Ifthe“between”variationisnotremoved,theerrorsmayexhibitautocorrelation,notinthe
usualtime-seriessensebutinthesensethatthemeanerrorforunitimaydifferfromthatof
unitj. (ThisisparticularlyrelevantwhenestimationisbypooledOLS.)
Gretlcurrentlyofferstworobustcovariancematrixestimatorsspecificallyforpaneldata.Theseare
availableformodelsestimatedviafixedeffects, pooledOLS,andpooledtwo-stageleastsquares.
ThedefaultrobustestimatoristhatsuggestedbyArellano(2003),whichisHACprovidedthepanel
isofthe“largen,smallT”variety(thatis,manyunitsareobservedinrelativelyfewperiods).The
Arellanoestimatoris
ˆ
Ö
A
X
0
X
1
0
@
Xn
i1
X
0
i
ˆu
i
ˆu
0
i
X
i
1
A
X
0
X
1
whereXisthematrixofregressors(withthegroupmeanssubtracted,inthecaseoffixedeffects)ˆu
i
denotesthevectorofresidualsforuniti,andnisthenumberofcross-sectionalunits.
2
Cameron
andTrivedi(2005)makeastrongcaseforusingthisestimator;theynotethattheordinaryWhite
HCCMEcanproducemisleadinglysmallstandarderrorsinthepanelcontextbecauseitfailstotake
2
Thisvarianceestimatorisalsoknownasthe“clustered(overentities)”estimator.
C# Create PDF from images Library to convert Jpeg, png images to
C# Create PDF from Raster Images, .NET Graphics and REImage File with XDoc Batch convert PDF documents from multiple image formats, including Jpg, Png, Bmp
convert pdf to jpg batch; bulk pdf to jpg
C# Image Convert: How to Convert Adobe PDF to Jpeg, Png, Bmp, &
C# sample code for PDF to jpg image conversion. This demo code convert PDF file all pages to jpg images. // Define input and output files path.
conversion of pdf to jpg; convert pdf file to jpg
Chapter17. Robustcovariancematrixestimation
154
autocorrelationintoaccount. InadditionStockandWatson(2008)showthattheWhiteHCCMEis
inconsistentinthefixed-effectspanelcontextforfixedT>2.
Incaseswhereautocorrelation isnotan issue theestimator r proposed by Beck and Katz (1995)
anddiscussedbyGreene(2003,chapter13)maybeappropriate. Thisestimator,whichtakesinto
accountcontemporaneouscorrelationacrosstheunitsandheteroskedasticitybyunit,is
ˆ
Ö
BK
X
0
X
1
0
@
Xn
i1
Xn
j1
ˆ
ij
X
0
i
X
j
1
A
X
0
X
1
Thecovariancesˆ
ij
areestimatedvia
ˆ
ij
ˆ
u
0
i
ˆ
u
j
T
whereisthelengthofthetimeseriesforeachunit. BeckandKatzcalltheassociatedstandard
errors “Panel-Corrected Standard Errors”(PCSE). . This s estimator r can beinvoked d in gretl via the
command
set pcse e on
TheArellanodefaultcanbere-establishedvia
set pcse e off
(Notethatregardlessofthepcsesetting,therobustestimatorisnotusedunlessthe--robustflag
isgiven,orthe“Robust”boxischeckedintheGUIprogram.)
17.5 Thecluster-robustestimator
Onefurthervarianceestimatorisavailableingretl,namelythe“cluster-robust”estimator.Thismay
beappropriate(forcross-sectionaldata,mostly)whentheobservationsnaturallyfallintogroupsor
clusters,andonesuspectsthattheerrortermmayexhibitdependencywithintheclustersand/or
have avariance that differs s across clusters. . Suchclusters s maybebinary (e.g. employed versus
unemployedworkers),categoricalwithseveralvalues(e.g.productsgroupedbymanufacturer)or
ordinal(e.g.individualswithlow,middleorhigheducationlevels).
Forlinearregressionmodelsestimatedvialeastsquarestheclusterestimatorisdefinedas
ˆ
Ö
C
X
0
X
1
0
@
mX
j1
X
0
j
ˆu
j
ˆu
0
j
X
j
1
A
X
0
X
1
wheremdenotesthenumberofclusters,andX
j
andˆu
j
denote,respectively,thematrixofregres-
sorsandthevector ofresidualsthatfallwithincluster j. Asnotedabove, , theArellanovariance
estimatorforpaneldatamodelsisaspecialcaseofthis,wheretheclusteringisbypanelunit.
FormodelsestimatedbythemethodofMaximumLikelihood(inwhichcasethestandardvariance
estimatoristheinverseofthenegativeHessian,H),theclusterestimatoris
ˆ
Ö
C
H
1
0
@
mX
j1
G
0
j
G
j
1
A
H
1
whereG
j
isthesumofthe“score”(thatis,thederivativeoftheloglikelihoodwithrespecttothe
parameterestimates)acrosstheobservationsfallingwithinclusterj.
Itiscommontoapplyadegreesoffreedomadjustmenttotheseestimators(otherwisethevariance
mayappearmisleadinglysmallincomparisonwithother estimators,ifthenumber ofclustersis
small). Intheleastsquarescasethefactorism=m 1n 1=n k,wherenisthetotal
numberofobservationsandkisthenumberofparametersestimated;inthecaseofMLestimation
thefactorisjustm=m 1.
C# Image Convert: How to Convert Dicom Image File to Raster Images
RasterEdge.XDoc.Office.Inner.Office03.dll. RasterEdge.XDoc.PDF.dll. This demo code convert dicom file all pages to jpg images.
batch convert pdf to jpg; convert multi page pdf to jpg
VB.NET PDF Convert to Images SDK: Convert PDF to png, gif images
Convert PDF documents to multiple image formats, including Jpg, Png, Bmp, Gif, Tiff, Bitmap, .NET Graphics, and REImage. Turn multipage PDF file into image
advanced pdf to jpg converter; convert pdf photo to jpg
Chapter17. Robustcovariancematrixestimation
155
Availabilityandsyntax
Thecluster-robustestimatoriscurrentlyavailableformodelsestimatedviaOLSandTSLS,andalso
formostMLestimatorsotherthanthosespecializedfortime-seriesdata: binarylogitandprobit,
orderedlogitandprobit,multinomiallogit,Tobit,intervalregression,biprobit,countmodelsand
durationmodels.Inallcasesthesyntaxisthesame:yougivetheoptionflag--cluster=followed
bythenameoftheseriestobeusedtodefinetheclusters,asin
ols y 0 0 x1 1 x2 --cluster=cvar
Thespecifiedclusteringvariablemust(a)bedefined(notmissing)atallobservationsusedinesti-
matingthemodeland(b)takeonatleasttwodistinctvaluesovertheestimationrange.Theclusters
aredefinedassetsofobservationshavingacommonvaluefortheclusteringvariable.Itisgenerally
expectedthatthenumberofclustersissubstantiallylessthanthetotalnumberofobservations.
Chapter18
Paneldata
18.1 Estimationofpanelmodels
PooledOrdinaryLeastSquares
ThesimplestestimatorforpaneldataispooledOLS.Inmostcasesthisisunlikelytobeadequate,
butitprovidesabaselineforcomparisonwithmorecomplexestimators.
IfyouestimateamodelonpaneldatausingOLSanadditionaltestitembecomesavailable. Inthe
GUImodelwindowthisistheitem“paneldiagnostics”undertheTestsmenu;thescriptcounterpart
isthehausmancommand.
Totakeadvantageofthistest,youshouldspecifyamodelwithoutanydummyvariablesrepresent-
ingcross-sectionalunits.ThetestcomparespooledOLSagainsttheprincipalalternatives,thefixed
effectsandrandomeffectsmodels. Thesealternativesareexplainedinthefollowingsection.
Thefixedandrandomeffectsmodels
Inthegraphicalinterfacetheseoptionsarefoundunder themenuitem“Model/Panel/Fixedand
randomeffects”.Inthecommand-lineinterfaceoneusesthepanelcommand,withorwithoutthe
--random-effectsoption.
Thissectionexplainsthenatureofthesemodelsandcommentsontheirestimationviagretl.
ThepooledOLSspecificationmaybewrittenas
y
it
X
it
u
it
(18.1)
wherey
it
istheobservationonthedependentvariableforcross-sectionalunitiinperiodtX
it
is a1kvector ofindependentvariablesobservedfor unitin period tis ak1vector of
parameters,andu
it
isanerrorordisturbancetermspecifictounitiinperiodt.
Thefixed and randomeffects models haveincommonthattheydecomposetheunitarypooled
errorterm,u
it
.Forthefixedeffectsmodelwewriteu
it
i
"
it
,yielding
y
it
X
it
i
"
it
(18.2)
Thatis,wedecomposeu
it
intoaunit-specificandtime-invariantcomponent,
i
,andanobservation-
specificerror,"
it
.
1
The
i
sarethentreatedasfixedparameters(ineffect,unit-specificy-intercepts),
whicharetobeestimated.Thiscanbedonebyincludingadummyvariableforeachcross-sectional
unit(andsuppressingtheglobalconstant).ThisissometimescalledtheLeastSquaresDummyVari-
ables(LSDV)method. Alternatively,onecansubtractthegroupmeanfromeachofvariablesand
estimateamodelwithoutaconstant.Inthelattercasethedependentvariablemaybewrittenas
˜y
it
y
it
¯y
i
The“groupmean”,
¯
y
i
,isdefinedas
¯y
i
1
T
i
T
i
X
t1
y
it
1
Itispossibletobreakathirdcomponentoutofu
it
,namelyw
t
,ashockthatistime-specificbutcommontoallthe
unitsinagivenperiod.Intheinterestofsimplicitywedonotpursuethatoptionhere.
156
Chapter18. Paneldata
157
whereT
i
isthenumberofobservationsforuniti.Anexactlyanalogousformulationappliestothe
independentvariables.Givenparameterestimates,
ˆ
,obtainedusingsuchde-meaneddatawecan
recoverestimatesofthe
i
susing
ˆ
i
1
T
i
T
i
X
t1
y
it
X
it
ˆ
Thesetwomethods(LSDV,andusingde-meaneddata)arenumericallyequivalent. gretltakesthe
approachofde-meaningthedata.Ifyouhaveasmallnumberofcross-sectionalunits,alargenum-
beroftime-seriesobservationsperunit,andalargenumberofregressors,itismoreeconomical
intermsofcomputermemorytouseLSDV.Ifneedbeyoucaneasilyimplementthismanually.For
example,
genr unitdum
ols y x x du_*
(SeeChapter9fordetailsonunitdum).
Theˆ
i
estimatesarenotprintedaspartofthestandardmodeloutputingretl(theremaybealarge
numberofthese,andtypicallytheyarenotofmuchinherentinterest). Howeveryoucanretrieve
themafter estimationofthefixedeffectsmodelifyouwish. . Inthegraphicalinterface,go o tothe
“Save”menuinthemodelwindowandselect“per-unitconstants”.Incommand-linemode,youcan
doseriesnewname=$ahat,wherenewnameisthenameyouwanttogivetheseries.
Fortherandomeffectsmodelwewriteu
it
v
i
"
it
,sothemodelbecomes
y
it
X
it
v
i
"
it
(18.3)
Incontrasttothefixedeffectsmodel,thev
i
sarenottreatedasfixedparameters,butasrandom
drawingsfromagivenprobabilitydistribution.
ThecelebratedGauss–Markovtheorem, according to whichOLSis thebestlinearunbiasedesti-
mator (BLUE), , depends on n the assumption that the error term is independently and identically
distributed(IID).Inthepanelcontext,theIIDassumptionmeansthatEu
2
it
,inrelationtoequa-
tion18.1,equalsaconstant,
2
u
,foralliandt,whilethecovarianceEu
is
u
it
equalszeroforall
standthecovarianceEu
jt
u
it
equalszeroforallji.
Iftheseassumptionsarenotmet—andtheyareunlikelytobemetinthecontextofpaneldata—
OLSisnotthemostefficientestimator. Greaterefficiencymaybegainedusinggeneralizedleast
squares(GLS),takingintoaccountthecovariancestructureoftheerrorterm.
Considerobservationsonagivenunitiattwodifferenttimessandt.Fromthehypothesesabove
itcanbeworkedoutthatVaru
is
Varu
it
2
v
2
"
,whilethecovariancebetweenu
is
andu
it
isgivenbyEu
is
u
it
2
v
.
Inmatrixnotation,wemaygroupalltheT
i
observationsforunitiintothevectory
i
andwriteitas
y
i
X
i
u
i
(18.4)
Thevectoru
i
,whichincludesallthedisturbancesforindividuali,hasavariance–covariancematrix
givenby
Varu
i
Ö
i
2
"
I
2
v
J
(18.5)
whereJisasquarematrixwithallelementsequalto1.Itcanbeshownthatthematrix
K
i
I 
i
T
i
J;
where
i
1 
r
2
"
2
"
T
i
2
v
,hastheproperty
K
i
ÖK
0
i
2
"
I
Chapter18. Paneldata
158
Itfollowsthatthetransformedsystem
K
i
y
i
K
i
X
i
K
i
u
i
(18.6)
satisfies theGauss–Markovconditions, and OLSestimationof(18.6)provides efficientinference.
Butsince
K
i
y
i
y
i
i
¯y
i
GLSestimationisequivalenttoOLSusing“quasi-demeaned”variables;thatis,variablesfromwhich
wesubtractafractionoftheiraverage.Noticethatfor2
"
!0,!1,whilefor2
v
!0,!0.
Thismeansthatifallthevarianceisattributableto theindividualeffects,thenthefixedeffects
estimatorisoptimal;if,ontheotherhand,individualeffectsarenegligible,thenpooledOLSturns
out,unsurprisingly,tobetheoptimalestimator.
To implementtheGLSapproachweneed tocalculate, whichinturnrequiresestimatesofthe
variances 
2
"
and
2
v
. (Theseareoften n referred to o as the“within”and “between” ” variances s re-
spectively, sincetheformer refers tovariationwithineachcross-sectional unit and thelatter to
variationbetweentheunits). Severalmeansofestimatingthesemagnitudeshavebeensuggested
intheliterature(seeBaltagi,1995);bydefaultgretlusesthemethodofSwamyandArora(1972):
2
"
is estimatedbytheresidualvariancefromthefixedeffects model,andthesum2
"
T
i
2
v
is
estimatedasT
i
timestheresidualvariancefromthe“between”estimator,
¯y
i
¯
X
i
e
i
Thelatter regressionis implemented byconstructing a a data set consisting of thegroup means
ofalltherelevantvariables. Alternatively,ifthe--nerloveoptionisgiven,gretlusesthemethod
suggestedbyNerlove(1971).Inthiscase
2
v
isestimatedasthesamplevarianceofthefixedeffects,
ˆ
2
v
1
1
Xn
i1

i
¯
2
wherenisthenumberofindividualsand ¯isthemeanofthefixedeffects.
Choiceofestimator
Whichpanelmethodshouldoneuse,fixedeffectsorrandomeffects?
Onewayofansweringthisquestionisinrelationtothenatureofthedataset.Ifthepanelcomprises
observationsonafixedandrelativelysmallsetofunitsofinterest(say,thememberstatesofthe
EuropeanUnion),thereisapresumptioninfavoroffixedeffects.Ifitcomprisesobservationsona
largenumberofrandomlyselectedindividuals(asinmanyepidemiologicalandotherlongitudinal
studies),thereisapresumptioninfavorofrandomeffects.
Besidesthisgeneralheuristic,however,variousstatisticalissuesmustbetakenintoaccount.
1. Somepaneldatasetscontainvariableswhosevaluesarespecifictothecross-sectionalunit
butwhichdonotvaryovertime.Ifyouwanttoincludesuchvariablesinthemodel,thefixed
effectsoptionissimplynotavailable. Whenthefixedeffectsapproachisimplementedusing
dummyvariables,theproblemisthatthetime-invariantvariablesareperfectlycollinearwith
theper-unitdummies.Whenusingtheapproachofsubtractingthegroupmeans,theissueis
thatafterde-meaningthesevariablesarenothingbutzeros.
2. Asomewhatanalogousprohibitionappliestotherandomeffectsestimator.Thisestimatoris
ineffectamatrix-weightedaverageofpooledOLSandthe“between”estimator. Supposewe
haveobservationsonnunitsorindividualsandtherearekindependentvariablesofinterest.
Ifk>n,the“between”estimatorisundefined—sincewehaveonlyneffectiveobservations—
andhencesoistherandomeffectsestimator.
2
Inabalancedpanel,thevalueofiscommontoallindividuals,otherwiseitdiffersdependingonthevalueofT
i
.
Chapter18. Paneldata
159
Ifonedoesnotfallfoulofoneorotheroftheprohibitionsmentionedabove,thechoicebetween
fixedeffects andrandomeffects maybeexpressed interms ofthetwo o econometric desiderata,
efficiencyandconsistency.
Fromapurelystatisticalviewpoint, wecouldsaythatthereisatradeoffbetweenrobustnessand
efficiency.Inthefixedeffectsapproach,wedonotmakeanyhypothesesonthe“groupeffects”(that
is, thetime-invariantdifferences in meanbetweenthegroups) beyondthefactthattheyexist—
andthatcanbetested; seebelow. . Asaconsequence, , oncetheseeffectsaresweptoutbytaking
deviationsfromthegroupmeans,theremainingparameterscanbeestimated.
Ontheotherhand,therandomeffectsapproachattemptstomodelthegroupeffectsasdrawings
fromaprobabilitydistributioninsteadofremovingthem. Thisrequiresthatindividualeffectsare
representableas alegitimatepartof thedisturbanceterm, thatis, zero-meanrandomvariables,
uncorrelatedwiththeregressors.
Asaconsequence,thefixed-effectsestimator“alwaysworks”,butatthecostofnotbeingableto
estimatetheeffectoftime-invariantregressors. Thericher r hypothesissetoftherandom-effects
estimator ensuresthatparameters fortime-invariantregressorscan n beestimated,and thatesti-
mationoftheparametersfortime-varyingregressorsiscarriedoutmoreefficiently.Theseadvan-
tages,though,aretiedtothevalidityoftheadditionalhypotheses. If,forexample,thereisreason
tothinkthatindividualeffectsmaybecorrelatedwithsomeoftheexplanatoryvariables,thenthe
random-effectsestimatorwouldbeinconsistent,whilefixed-effectsestimateswouldstillbevalid.
ItispreciselyonthisprinciplethattheHausmantestisbuilt(seebelow):ifthefixed-andrandom-
effectsestimatesagree,towithintheusualstatisticalmarginoferror,thereisno reasontothink
theadditionalhypothesesinvalid,andasaconsequence,noreasonnottousethemoreefficientRE
estimator.
Testingpanelmodels
Ifyouestimateafixedeffectsorrandomeffectsmodelinthegraphicalinterface,youmaynotice
thatthenumberofitemsavailableunderthe“Tests”menuinthemodelwindowisrelativelylimited.
Panelmodelscarry certaincomplications thatmakeitdifficulttoimplementallofthetestsone
expectstoseeformodelsestimatedonstraighttime-seriesorcross-sectionaldata.
Nonetheless,variouspanel-specifictestsareprintedalongwiththeparameterestimatesasamatter
ofcourse,asfollows.
Whenyouestimateamodelusing fixedeffects, youautomatically getanF-testfor thenullhy-
pothesisthatthecross-sectionalunitsallhaveacommonintercept. Thatistosaythatallthe
i
s
areequal,inwhichcasethepooledmodel(18.1),withacolumnof1sincludedinthematrix,is
adequate.
When you estimateusing random effects, , theBreusch–Paganand d Hausmantests arepresented
automatically.
TheBreusch–Pagantestisthecounterpartto theF-testmentionedabove. . Thenullhypothesisis
thatthevarianceofv
i
inequation(18.3)equalszero;ifthishypothesisisnotrejected,thenagain
weconcludethatthesimplepooledmodelisadequate.
TheHausmantestprobestheconsistencyoftheGLSestimates. Thenullhypothesisisthatthese
estimates areconsistent—that is, thattherequirement of orthogonalityofthev
i
andthe X
i
is
satisfied.Thetestisbasedonameasure,H,ofthe“distance”betweenthefixed-effectsandrandom-
effectsestimates,constructedsuchthatunderthenullitfollowsthe
2
distributionwithdegrees
offreedomequalto thenumberoftime-varying regressorsinthematrixX. IfthevalueofHis
“large”thissuggeststhattherandomeffectsestimatorisnotconsistentandthefixed-effectsmodel
ispreferable.
TherearetwowaysofcalculatingH,thematrix-differencemethodandtheregressionmethod.The
procedureforthematrix-differencemethodisthis:
Documents you may be interested
Documents you may be interested