(完整版)EViews面板数据模型估计教程.docx
EViews6.0beta在面板数据模型估计中的应用 来自免费的minixi1、进入工作目录cdd:nklx3,在指定的路径下工作是一个良好的习惯2、建立面板数据工作文件workfile(1)最好不要选择EViews默认的blanacedpanel类型Moren_panel(2)按照要求建立简单的满足时期周期和长度要求的时期型工作文件Viewprocl Object /aJpmtNameFreezeEdit+上Order+/-|srnpl+/-Format | TitleEstimate | DefinePoolGEr|s5. 65EstimateMake ResidualsMake Group.Make Period Stats series.Make ModelMake System.Update Coefs from PoolLNY?| LNK?LNDH?B5.6519985.0006768.1!B5.7830025.28142383i b5.9815075.43502183B6.1646065.6846398.4;_B6.2489145.7038898.5:BGenerate Pool series., Delete Pool series.6.3896005.7148758.6IB6.5395055.96798886B6.7320796.35246086BStore Pool series (DB).Fetch Pool series (DB).Import Pool data (ASCII,XLS,WK?).Export Pool data (ASCIIXLS/WK?)6.94706867073698.7IB7.2089377.0477068.7IB7.3847916.9501428.7IB7.4947247.05069487BEIJING-1998BEIJING-19987.5983067.17685286B 日 JING1999B 日 JING-19997.6726877.2620738.61BEIJING-2000BEIJING-20007.7964137.2490708.7I二JBEIJING-2001<|,-1! x|混合模型的设置混合模型的结果D 即 endentVariable:LNY?MethodPooledLeastSquaresDate:05/24/07Time:20:30Sampled 9862005 lncludedobservations:20Cross-sectionsincluded:29Totalpool(balanced)observations:580VariableVariableCoefficientt-Std.Error o.StatisticProb.C LNK? LNDH? LNXH? LNNE1? LNCE1?-0.8602430.8291890.2613960.237727-0.1452770.0901580.1213960.0130590.0120050.0556280.0638190.056143-7.08627763.495921.77394.27347-2.2763741.605870.0000.0000.0000.0000.0230.108-2Q-2QR-squaredAdjustedR-squaredFnfronroAQinn0.986459Meandependentvar7.0861380.9863411.240231n 1AAOAinfnrrit&rinn-1 nidRna9、建立变系数模型这里只建立一次变一个变量且在截面维的变系数模型。当然也可是在时间维的变系数。而且可以一次不止变一个变量的系数。变系数模型的设置变系数模型的估计结果DependentVariable:LNY?Method:PooledLeastSquaresDate:05/24/07Time:20:37Sampled 9862005 lncludedobservations:20Cross-sectionsincluded:29Totalpool(balanced)observations:580VariableCoefficient Std.Error t-Statistic Prob.CLNDH?LNXH?LNNE1?LNCE1?BEIJING-LNKBEIJINGTIANJIN-LNKTIANJINHEBEI-LNKHEBEISHANXI_D-LNKSHANXI_DNEIMENG-LNKNEIMENGLIAONING-LNKLIAONINGJILIN-LNKJILINHLJIANG-LNKHLJIANG-1.0909600.3031280.191757-0.2482310.6448430.7414960.7727700.7493170.7416180.7436640.7869310.7658240.7833390.215765-5.0562320.00000.02609311.617090.00000.1201801.5955750.1110.075168-3.3023300.00100.0814977.9124580.00000.02224433.334790.0000.02240234.496290.00000.01875839.947250.00000.02142234.619030.0000.02129534.921500.00000.01974639.852630.00000.02165935.358240.00000.02071837.808940.00010、建立截距维的固定效应模型,并检验模型的冗余性(是否比混合模型优?) 截面维固定效应模型的设置截面维固定效应模型的估计结果D 即 endentVariable:LNY?MethodPooledLeastSquaresDate:05/24/07Time:20:42Sampled 9862005 lncludedobservations:20Cross-sectionsincluded:29Totalpool(balanced)observations:580Variable Coefficient Std.Error t-Statistic Prob.CLNK?LNDH?LNXH?LNNE1?LNCE1?FixedEffects(Cross)BEIJING-CTIANJIN-CHEBEI-CSHANXI_D-CNEIMENG-CLIAONING-C-0.7852040.6907670.1038981.349762-0.1652170.352876-0.614424-0.4369070.113717-0.207641-0.2093320.0956550.2676490.0200640.0385400.1780520.0726970.082821-2.93370834.427312.6958287.580724-2.2726614.2606880.0030.0000.0070.0000.0230.000截面维固定效应模型的冗余性检验,首先在pool模型的view中选择似然比的检验 菜单选项 PookFAZHANMOXIWorkfile:SHSH02:yongxufazhanmoxi-|n冈v!Proc Object|Print|Name|FreezeEstimate Define|PoolGenr|SheetCrossSectionidentifiersRepresentationsEstimationOutputResiduals匚 oef 匚 ovarianceMatrix匚 oefficientTestsRedundantFixedEffects-LikelihoodRatioCorrelatedRandomEffects-HausmanTestJ40.267649-2.9337080.003370.02006434.427310.000980.0385402.6958280.00732-0.1780527.5807240.0000.1652170.0.072697-2.2726610.0233528760.0828214.2606880.000Fixed/RandomEffectsTestingSpreadsheet(stackeddata).DescriptiveStatistics.UnitRootTest.CointegrationTest.LabelLNNE1?LNCE1?Fi ver i Ff f ert* ;f U rcM/似然比检验的结果,零假设固定效应模型是冗余的,小概率事件发生,拒绝冗 余,于是摒弃混合模型:RedundantFixedEffectsTestsPookFAZHANMOXIT estcross-sectionfixedeffectsEffectsTestStatisticd.f.Prob.Cross-sectionF18.205856(28,546)0.0000Cross-sectionChi-square382.452544280.0000Cross-sectionfixedeffectstestequation:D 即 endentVariable:LNY?MethodPanelLeastSquaresDate:05/24/07Time:20:47Sampled 9862005lncludedobservations:20Cross-sectionsincluded:29Totalpool(balanced)observations:580Coefficient Std. Error t-Statistic Prob.C-0.8602430.121396-7.0862770.0000LNK?0.8291890.01305963.49591 q.OOOO11、建立截距维的随机效应模型,并进行Hausman检验,确定是选择随机效应亦或是固定效应模型,零假设:随机效应模型成立。截面维随机效应模型的设置截面维随机效应模型的估计结果D 即 endentVariable:LNY?Method:PooledEGLS(Cross-sectionrandomeffects) Date :05/24/07Time:20:56Sampled 9862005lncludedobservations:20Cross-sectionsincluded:29Totalpool(balanced)observations:580SwamyandAroraestimatorofcomponentvariancesVariableCoefficientStd.Errort-StatisticProb.LNK?LNDH?LNXH?LNNE1?LNCE1?RandomEffects(Cross)BEIJING-CTIANN"CHEBEI-CSHANXI_D-CNEIMENG-C-1.2662660.7567330.2780840.488510-0.1295320.390160-0.243423-0.042283-0.043812-0.113288-0.0735890.1990890.0163140.0200820.0988490.0670900.07114646.386313.84714.942005.483910.00000.00000.00000.00000.05400.0000截面维随机效应模型的Hausman检验菜单项的选择JhPooI:FAZHANMOXI Workfile:SHSH02:yongxufazhanmoxiPiew!IProdObjectIPintINameFeeze | EstimateDefinePoolGenrSheet lCrossSectionldentifiersRepresentationsEstimationOu tputResidualsA匚 oefCovarianceMatrix匚 oefficientTests| |Fixed/RandomEffectsT estingSpreadsheet(stackeddata).DescriptiveStatistics.UnitRootTest.CointegrationTest.Labelactionrandomeffects)n: -AAO,RedundantEixedEffects-LikelihoodRatioC crralatQrlRanrlcmFffarts-Hai ismanTavt*ntStd.Errort-StatisticProb.截面维随机效应模型Hausman检验的结果:Hausman检验的零假设是应当选择随机效应模型,小概率事件发生拒绝零假设选 择固定效应模型CorrelatedRandomEffects-HausmanTestPookFAZHANMOXI T estcross-sectionrandomeffectsTestSummaryTestSummaryChi-Sq.Statistic Chi-Sq.d.f. Prob.Cross-sectionrandom53.3940040.000Cross-sectionrandomeffectstestcomparisons:VariableFixed Random Var(Diff.) Prob.LNK?LNDH?LNXH?LNNE1?LNCE1?0.6907670.1038981.349762-0.1652170.3528760.7567330.2780840.488510-0.1295320.3901600.0001360.0010820.0219310.0007840.0017980.0000.0000.0000.2020.37912、13在时间维重复10、和11、的 工作,确定数据适合采用何种模14、建立截面变截距模型,分析没有观察的截面单元因素的影响截面变截距模型的设置Workfile Create-Workfile structure type|Dated - regular frequency |Date specificationFrequency Annual |Irregular Dated and Panel workfiles may be made from Unstructured workfiles by later specifying date and/or other identifier series.Start date: 1986End date: (2005OKCancel-Names (optional)- WF: |doctor_01|Page:3、建立pool对象 (1)新建对象2)选择新建对象类型并命名(3)为新建pool对象设置截面单元的表示名称,在此提示下 _(CrossSectionidentifiers: (Enteridentifiersbelowthisline)输入截面单元名称。,建议采用汉语拼音,例如29个省市区的汉语拼音,建议在拼音名前加一个下划线Specification |Options Dependent variable|lny?Estimation methodFixed and RandomCros s-secti FixedIPeriod |None三|Weights |no weights|Regressors and AR() termsCommonInk? Indh? Inxh? Innel? Inc巳1?二J确定截面变截距模型的估计结果DependentVariable:LNY?MethodPooledLeastSquaresDate:05/24/07Time:21:05Sampled 9862005 lncludedobservations:20Cross-sectionsincluded:29Totalpool(balanced)observations:580Variable Coefficient Std.Error t-Statistic Prob.CLNK?LNDH?LNXH?LNNE1?LNCE1?-0.7852040.6907670.1038981.349762-0.1652170.3528760.267649-2.9337080.02006434.427310.0385402.6958280.1780527.5807240.072697-2.2726610.0828214.2606880.0030.0000.0070.0000.0230.000FixedEffects(Cross)BEIJING-C-0.614424TIANJIN-C-0.436907HEBEI-C0.113717SHANXI_D-C -0.207641NEIMENG-C-0.209332LIAONING-C0.09565515、建立时期变截距模型,分析没有观察的时期因素的影响时期变截距模型的设置时期变截距模型的估计结果D 即 endentVariable:LNY?MethodPooledLeastSquaresDate:05/24/07Time:21:08Sampled 9862005 lncludedobservations:20Cross-sectionsincluded:29Totalpool(balanced)observations:580Variable Coefficient Std.Error t-Statistic Prob.C LNK? LNDH? LNXH? LNNE1? LNCE1?-0.6582070.7467130.3210070.2479490.087265-0.4359990.1175020.0189260.0152940.0528900.0856730.080745-5.60164739.4535420.989584.6879811.018583-5.3997150.000 n0.0000.0000.0000.3080.000FixedEffects(Period)1986-C-0.1907931987-C-0.1966561988-C-0.1490011989-C1990-C1991-C-0.146982-0.112004-0.10882016、在整个估计、检验构成中养成使用冻结和命名保存的习惯,以便撰写报告时调用。TAble:UNTITLEDWoricfile:SHSH02: : Y(mgjciifazhanm- 中 iewPrci 匚|obiazt|Print|Nmme|Edit+/CellFmtGrid+/TitleCcimments+/-lABCDEdD 即 endentVariable:LNY?OMethodPooledLeastSquaresQDate:05/24/07Time:21:08ASampled 9862005lncludedobservations:20uCross-sectionsincluded:29ITotalpool(balanced)observations:580十VariableCoefficientStd. Errort-StatisticProb.11C-0.6582070.117502A Am A470.000 n1 oLNK?0.746710.01892639.45350.000d QLNDH?0.321000.01529420.98950.0004 ALNXH?0.247940.0528904.687980.000-t 二LNNE1?0.087260.0856731.018580.308LNCE1?-0.4359990.080745-0.0004 rFixedEffects(Period)1817、工作中注意使用工作文件窗口顶部的显示过滤器,简化你的窗口,以免眼花 缭乱。过虑前Workfile :SHSH02-(e:newdatash.|SA|ViewProc | Object |PrintSaveDetails+/-l ShowFetchStoreDeleteGenr|SampleRange: 19862005-20obsDisplayFilter:*SamDle:19062005-20obsEcSIncelguizhouSIncel shanxi_d=dwg j nc :巳 1Slncelhainan0lnce1shanxi_x=dwg j ncIhSIncelhebeiOIncelsichuan=»=dwg j nkSIncelhenanOInceltianjin=dwgjnlSlncelhljiangOlncelxinjiang二二二dwg门门已 ISIncelhubeiOIncelyunnan=dwgjnyOlncelhunanOlncelzhejiang=»=dwg_lny_02SlnceljiangsuSlnce2anhui回 fazhanmoxiSlnceljiangxi0lnce2beijingEgroupdSlnceljilin0lnce2fujian0lncelanhuiSlncelliaoning0lnce2gansu0lncelbeijingSlncelneimeng0lnce2guangdongshengchanhanshuyongxufa选择过虑Object FilterName filter (or multiple filters separated by spaces)Includer Series :“ AlphasOKOKCancelp| Links“ Groups - Samples - Vai maps“ Graphs - Tables - Textp Estimation objects (i.e. equations, systems, .)“ Models“ Matrix algebra objects (i.e. matrices3scalars3过虑后二I冈ViewPnzi 匚匚 t|PrintSaveDetails+/TShowFetchStoeDeletEGenrSamWeRange: 19062005-20obsDisplayFilter:-*Q n mnl 口 IQPIPiQnnc;一QDiiHqmoxLhunhe?=moxi_shiqLguding moxi_shiqi_suiji 回阿-一回p02回pO4?=test_diqu_gudi_ry? =test_diqu_suiji_hau.?= test-ShiqAguding- ry1test_shiqi_suiji_hau.?= =test_xiezhengjianyantest _xuezhengjiany.LiLklitkLiLkLibkT-ibkLibkT-ibkrlw dw dw dw dw dw dwInnpl Indh Ink Ini Innpl InvInv 0EBfazhanmoxiEgroup 01 ?=I nd h_u n ite_root?= =lnk unite root testV(曾,sWorkfile£SHSH02<A(eAnewdatash.ny_unite_root_test?=moxibiabxishuCl 9Q.。aq对同一组数据处理两个模型,例如生产函数和增长模型,可以导出page,在导入 page,使它们既有联系又有区别。18、祝大家好运,也祝贺在下从北京地质学院毕业50周年,十分荣幸我的校友5 月15日在北京举行了纪念会;十分荣幸杨遵义院士(古生物)、王鸿祯院士(地 史)、涂光织院士(矿床,同班小王成了涂夫人,可惜,自古红颜多薄命)和张 本仁院士(南京大学研究生毕业,教完构造课就成了右派?,教课时还不是院 士)是在下的院士老师,还有许多老师都将永远的铭记,教数学的女老师(苏教 授的夫人),教俄语的王语今教授。也特向我在武汉大学的老师张尧庭教授、冯 文权教授致敬。特发此贴祝福我的老师们和同学们健康。谢谢。19、面板数据优点很多,但是请注意面板数据模型方法的协方差分析的方法学特 性,它是将其他序列的影响保持固定,并从总变异中扣除它们的影响以后,再判 别目标序列的差异显著性。,如图关闭建立的pool对象,它就出现在当前工作文件中。JPath = d:nklx3 DB = none WF = doctor 01如典以New Page/日Ie Edit ODject View Proc Quick Options Window Help cd d:nklx34、在pool对象中建立面板数据序列双击pool对象,打开pool对象窗口,在菜单view的下拉项中选择spreedsheet (展开表)在打开的序列列表窗口中输入你要建立的序列名称,如果是面板数据序列必须 在序列名后添加“? ”例如,输入GDP?,在GDP后的?的作用是各个截面单元 的占位符,生成了 29个省市区的GDP的序列名,即GDP后接截面单元名,再 在接时期,就表示出面板数据的3维数据结构(1变量2截面单元3时期)了。W EViewsJnl x|请看工作文件窗口中的序列名。展开表(类似excel)中等待你输入、贴入数-1! x|-1! x|据。WE ViewsFile Edit Object View Proc Quick Options Window Helpcd d:nklx3dA Untitled A New Page /Pool: POOL01Workfile:DOCTO R_01: :U n titled J£ _ 1口1 x|V iew| Pro匚Object | PrintNameZreeze Edit+/-Orcter+/-|Smpl+*Fermat|Title| Estimate|Da行nek00仁巳nr17|lobsGDP?K?_BEIJING-1986NANA_BEIJING1987NANA_BEIJING-1988NANA_BEIJING-1989NANA_BEI JING-1990NANA_BEIJING-1991业NA_BEI JING-1992NANA_BEIJING-1993NANA_BEIJING-1994 b 111tv21 gaprujian 0 k_anhui 0 k_beijinggapjiangsu 0 gdpjiangxi 0 gdpjilmKjiaorung 0 k_neimeng 0 k_ningxiaWF = doctor 01Path = d:nklx3 DB = none5、贴入数据(1)打开编辑(edit)窗2)贴入数据需 EViews-! x|Ei Ie Edit Object View Proc Quick Options Window Helpcd d:nklx3Pool: POOL 01 Workfile: DOCTOR.01:Untitled-1! x|obsGDP?K?_BEI JING-19865.6519985.000676一_BEIJING-1987.BEIJING-19885.7830025.9815075.2814235.435021_BEI JING-19896.1646065.684639_BEIJING1990_BEIJING-19916.2489146.3896005.7038895.714875_BEI JING-19926.5395055.967988_BEIJING-19936.732079 . MB6.3524605. 651998gaprujian 0 k_anhui 0 k beijinggapjiangsu 0 gdpjiangxi 0 gdpjilinbid Kjiaonmg 0 k_neimeng 0 k_ningxia“ -二二二 二二二二View|Proc| Object Print Name Freeze Edit+/- Orde+/Tsmpl+/T Format Title Estimate Define | PoolGenr|£小 Untitled 卜 New Page /2JPath = d:nklx3 DB = noneWF = doctor O 1(3)关闭pool窗口,赶快存盘见好就收6、在pool窗口对各个序列进行单位根检验选择单位根检验Pool: POOL 01 Workfile: DOCTOR 01:Untitled-In|x|plewl Proc I Object Print I Na meFreeze Edit+/- Order+/ |Smpl+/ I Format Title Estimate Define PoolGenr IsCross Section IdentifiersSpreadsheet (stacked data) .Descriptive Statistics .38Unit Root Test.Co integration Test.Label_BEIJING1 痈 IbEI JING-1992 BEIJING-19 而 -BEIJING-19942 )7 )6 14 6.389600K?5.0006765.2814235.4350215.6846395.7038895.7148756.5395056.732079 dHk. MBL±l5.9679886.352460设置单位根检验单位根检验结果PoolUnitRootTestonK?Poolunitroottest:SummarySeries:K_BEIJING,K_TIANJIN,K_HEBEI,K_SHANXI_D,K_NEIMENG,K_LiAONING,KjjiLIN,K_HLJIANG,K_SHANGHAI,K.JIANGSU,K_ZHEJIANG,K_ANHUI,K FUJIAN,K_JIANGXI,K_SHANDONG,K_HENAN,K_HUBEI,K_HUNAN,K_GUANGDONG, K_GUANdxi,KHAINAN,fCsiCHUArT 嚏 GUIZHOU,K_YUNNANJCsHANXAX,KAGANSU, KaQINGHAI,kJnINGXIA,K_XINJIANG-Date:05/24/07Time:19:57-Sample:19862005Exogenousvariables:lndividualeffectsAutomaticselectionofmaximumlagsAutomaticselectionofla gsbasedonSIC:0to4Newey-WestbandwidthselectionusingBartlettkernel*ProbabilitiesforFishertestsarecomputedusinganasymptoticChiMethodStatisticProb.*CrosssectionsObsNull:Unitroot(assumescomm