xtregpostestimation—Postestimationtoolsforxtreg469
Syntaxforpredict
Forallbutthepopulation-averagedmodel
????????????????
predicttypenewvarifin,statisticnooffsetPopulation-averagedmodel
????????????????
predicttypenewvarifin,PAstatisticnooffsetstatistic
Main
description
xbstdpue?
xbu?u?exjb,?ttedvalues;thedefaultstandarderrorofthe?ttedvaluesui+eit,thecombinedresidual
xjb+ui,predictionincludingeffectui,the?xed-orrandom-errorcomponenteit,theoverallerrorcomponent
Unstarredstatisticsareavailablebothinandoutofsample;typepredict...ife(sample)...ifwantedonlyfortheestimationsample.Starredstatisticsarecalculatedonlyfortheestimationsample,evenwhenife(sample)isnotspeci?ed.
PAstatisticMain
description
predictedprobabilityofdepvar;considerstheoffset()predictedprobabilityofdepvarlinearprediction
standarderrorofthelinearprediction
?rstderivativeoftheloglikelihoodwithrespecttoxjβ
muratexbstdpscoreThesestatisticsareavailablebothinandoutofsample;typepredictfortheestimationsample.
...ife(sample)...ifwantedonly
Menu
Statistics
>
Postestimation
>
Predictions,residuals,etc.
Optionsforpredict
££Main
??
xbcalculatesthelinearprediction,thatis,a+bxit.Thisisthedefaultforallexceptthepopulation-averagedmodel.stdpcalculatesthestandarderrorofthelinearprediction.Forthe?xed-effectsmodel,thisexcludesthevarianceduetouncertaintyabouttheestimateofui.muandratebothcalculatethepredictedprobabilityofdepvar.mutakesintoaccounttheoffset(),andrateignoresthoseadjustments.muandrateareequivalentifyoudidnotspecifyoffset().muisthedefaultforthepopulation-averagedmodel.
470xtregpostestimation—Postestimationtoolsforxtreg
uecalculatesthepredictionofui+eit.
xbucalculatesthepredictionofa+bxit+ui,thepredictionincludingthe?xedorrandomcomponent.ucalculatesthepredictionofui,theestimated?xedorrandomeffect.ecalculatesthepredictionofeit.
scorecalculatestheequation-levelscore,uj=?lnLj(xjβ)/?(xjβ).
nooffsetisrelevantonlyifyouspeci?edoffset(varname)forxtreg,pa.Itmodi?esthecalculationsmadebypredictsothattheyignoretheoffsetvariable;thelinearpredictionistreatedasxitbratherthanxitb+offsetit.
Syntaxforxttest0
xttest0
Menu
Statistics
>
Longitudinal/paneldata
>
Linearmodels
>
Lagrangemultipliertestforrandomeffects
Remarks
Example1
Continuingwithourxtreg,reestimationexample(example4)inxtreg,wecanseethatxttest0willreportatestofνi=0.Incasewehaveanydoubts,wecouldtype
.usehttp://www.stata-press.com/data/r11/nlswork
(NationalLongitudinalSurvey.YoungWomen14-26yearsofagein1968).xtregln_wgradeagec.age#c.agettl_expc.ttl_exp#c.ttl_exp>tenurec.tenure#c.tenure2.racenot_smsasouth,retheta(outputomitted).xttest0
BreuschandPaganLagrangianmultipliertestforrandomeffects
ln_wage[idcode,t]=Xb+u[idcode]+e[idcode,t]
Estimatedresults:
Var
ln_wage
eu
Test:
Var(u)=0
chi2(1)=14779.98Prob>chi2=0.0000
.2283326
.0845038.066514
sd=sqrt(Var)
.4778416.2906954.2579031
xtregpostestimation—Postestimationtoolsforxtreg471
Example2
Moreimportantly,afterxtreg,reestimation,hausmanwillperformtheHausmanspeci?cationtest.Ifourmodeliscorrectlyspeci?ed,andifνiisuncorrelatedwithxit,the(subsetof)coef?cientsthatareestimatedbythe?xed-effectsestimatorandthesamecoef?cientsthatareestimatedhereshouldnotstatisticallydiffer:
.xtregln_wgradeagec.age#c.agettl_expc.ttl_exp#c.ttl_exp>tenurec.tenure#c.tenure2.racenot_smsasouth,re(outputomitted)
.estimatesstorerandom_effects
.xtregln_wgradeagec.age#c.agettl_expc.ttl_exp#c.ttl_exp>tenurec.tenure#c.tenure2.racenot_smsasouth,fe(outputomitted)
.hausman.random_effects
Coefficients(b)(B).random_eff~sage
c.age#c.age
ttl_expc.ttl_exp#~p
tenure
c.tenure#c~e
not_smsa
south
.0359987-.000723.0334668.0002163.0357539-.0019701-.0890108-.0606309
.036806-.0007133.0290207.0003049.039252-.0020035-.1308263-.0868927
(b-B)Difference-.0008073-9.68e-06.0044461-.0000886-.0034981.0000334.0418155.0262618
sqrt(diag(V_b-V_B))
S.E.
.0013177.0000184.001711.000053.0005797.0000373.0062745.0081346
Test:
b=consistentunderHoandHa;obtainedfromxtreg
B=inconsistentunderHa,efficientunderHo;obtainedfromxtregHo:differenceincoefficientsnotsystematic
chi2(8)=(b-B)’[(V_b-V_B)^(-1)](b-B)
=149.44
Prob>chi2=0.0000
Wecanrejectthehypothesisthatthecoef?cientsarethesame.Beforeturningtowhatthismeans,
notethathausmanlistedthecoef?cientsestimatedbythetwomodels.Itdidnot,however,listgradeand2.race.hausmandidnotmakeamistake;intheHausmantest,wecompareonlythecoef?cientsestimatedbybothtechniques.
Whatdoesthismean?Wehaveanunpleasantchoice:wecanadmitthatourmodelismisspeci?ed—thatwehavenotparameterizeditcorrectly—orwecanholdthatourspeci?ca-tioniscorrect,inwhichcasetheobserveddifferencesmustbeduetothezerocorrelationofνiandthexitassumption.
Technicalnote
Wecanalsomechanicallyexploretheunderpinningsofthetest’sdissatisfaction.Inthecomparisontablefromhausman,itisthecoef?cientsonnotsmsaandsouththatexhibitthelargestdifferences.Inequation(1??)of[XT]xtreg,weshowedhowtodecomposeamodelintowithinandbetweeneffects.Let’sdothatwiththesetwovariables,assumingthatchangesintheaveragehaveoneeffect,whereastransitionalchangeshaveanother:
472xtregpostestimation—Postestimationtoolsforxtreg
.egenavgnsmsa=mean(not_smsa),by(idcode).generatedevnsma=not_smsa-avgnsmsa(8missingvaluesgenerated)
.egenavgsouth=mean(south),by(idcode)
.generatedevsouth=south-avgsouth(8missingvaluesgenerated)
.xtregln_wgradeagec.age#c.agettl_expc.ttl_exp#c.ttl_exp>tenurec.tenure#c.tenure2.raceavgnsmdevnsmavgsoudevsouRandom-effectsGLSregressionNumberofobsGroupvariable:idcodeNumberofgroupsR-sq:within=0.1723Obspergroup:min
between=0.4809avgoverall=0.3737max
Randomeffectsu_i~GaussianWaldchi2(12)corr(u_i,X)=0(assumed)Prob>chi2
ln_wagegrade
age
c.age#c.age
ttl_expc.ttl_exp#c.ttl_exp
tenurec.tenure#c.tenure2.raceavgnsmsadevnsmaavgsouthdevsouth
_conssigma_usigma_e
rho
Coef..0631716.0375196-.0007248.0286542.0003222.0394424-.0020081-.0545938-.1833238-.0887596-.1011235-.0598538.268298.25791607.29069544.44046285
Std.Err..0017903.0031186.00005.0024207.0001162.001754.0001192.0102099.0109337.0095071.0098787.0109054.0495776
z35.2912.03-14.5011.842.7722.49-16.85-5.35-16.77-9.34-10.24-5.495.41
P>|z|0.0000.0000.0000.0000.0060.0000.0000.0000.0000.0000.0000.0000.000
=======280914697
16.0159319.690.0000
[95%Conf.Interval].0596627.0314072-.0008228.0239097.0000945.0360045-.0022417-.0746048-.2047533-.1073932-.1204855-.081228.1711277
.0666805.043632-.0006269.0333987.0005499.0428803-.0017746-.0345827-.1618942-.070126-.0817616-.0384796.3654683
(fractionofvarianceduetou_i)
Wewillleavethereinterpretationofthismodeltoyou,exceptthatifwewerereallygoingtosellthismodel,wewouldhavetoexplainwhythebetweenandwithineffectsaredifferent.Focusingonresidenceinanon-SMSA,wemighttellastoryaboutruralpeoplebeingpaidlessandcontinuingtogetpaidlesswhentheymovetotheSMSA.Givenourpaneldata,wecouldcreatevariablestomeasurethis(anindicatorformovedfromnon-SMSAtoSMSA)andtomeasuretheeffects.Inourassessmentofthismodel,weshouldthinkaboutwomeninthecitiesmovingtothecountryandtheirrelativeproductivityinabucolicsetting.
xtregpostestimation—Postestimationtoolsforxtreg473
Inanycase,theHausmantestnowis
.estimatesstorenew_random_effects
.xtregln_wgradeagec.age#c.agettl_expc.ttl_exp#c.ttl_exp>tenurec.tenure#c.tenure2.raceavgnsmdevnsmavgsoudevsou,fe(outputomitted)
.hausman.new_random_effects
Coefficients(b)(B)(b-B)sqrt(diag(V_b-V_B)).new_random~sDifferenceS.E.age
c.age#c.age
ttl_expc.ttl_exp#~p
tenure
c.tenure#c~e
devnsmadevsouth
.0359987-.000723.0334668.0002163.0357539-.0019701-.0890108-.0606309
.0375196-.0007248.0286542.0003222.0394424-.0020081-.0887596-.0598538
-.0015211.84e-06.0048126-.0001059-.0036885.000038-.0002512-.0007771
.0013198.0000184.0017127.0000531.0005839.0000377.0006826.0007612
Test:
b=consistentunderHoandHa;obtainedfromxtreg
B=inconsistentunderHa,efficientunderHo;obtainedfromxtregHo:differenceincoefficientsnotsystematic
chi2(8)=(b-B)’[(V_b-V_B)^(-1)](b-B)
=92.52
Prob>chi2=0.0000
Wehavemechanicallysucceededingreatlyreducingtheχ2,butnotbyenough.Themajordifferences
nowareintheage,experience,andtenureeffects.Wealreadyknewthisproblemexistedbecauseoftheever-increasingeffectofexperience.Morecarefulparameterizationworkratherthansimplyincludingsquaresneedstobedone.
Methodsandformulas
Allpostestimationcommandslistedaboveareimplementedasado-?les.xttest0
xttest0reportstheLagrangemultipliertestforrandomeffectsdevelopedbyBreuschandPagan(1980)andasmodi?edbyBaltagiandLi(1990).Themodel
yit=α+xitβ+νit
is?tviaOLS,andthenthequantity
λLM
iscalculated,where
(nT)2=
2
??
A2??21
(iTi)?nT??
??n??Ti
(t=1vit)2i=1????2A1=1?
itvit
474xtregpostestimation—Postestimationtoolsforxtreg
TheBaltagiandLimodi?cationallowsforunbalanceddataandreducestothestandardformula
λLM
nT=
2(T?1)????????2
2
(v)iti??t???12vitit
whenTi=T(balanceddata).Underthenullhypothesis,λLMisdistributedχ2(1).
References
Baltagi,B.H.,andQ.Li.1990.ALagrangemultipliertestfortheerrorcomponentsmodelwithincompletepanels.
EconometricReviews9:103–107.Breusch,T.S.,andA.R.Pagan.1980.TheLagrangemultipliertestanditsapplicationstomodelspeci?cationineconometrics.ReviewofEconomicStudies47:239–253.Hausman,J.A.1978.Speci?cationtestsineconometrics.Econometrica46:1251–1271.
Sosa-Escudero,W.,andA.K.Bera.2008.Testsforunbalancederror-componentsmodelsunderlocalmisspeci?cation.StataJournal8:68–78.
Alsosee
[XT]xtreg—Fixed-,between-,andrandom-effects,andpopulation-averagedlinearmodels[U]20Estimationandpostestimationcommands
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库stata操作命令-xtreg(7)在线全文阅读。
相关推荐: