面板数据的stata分析.pdf
《面板数据的stata分析.pdf》由会员分享,可在线阅读,更多相关《面板数据的stata分析.pdf(24页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Longitudinal/Panel Data AnalysisRaymond DuchUniversity of OxfordNueld C 22,20081/24Readings1Gellman,Andrew and Jennifer Hill.2007.Data Analysis UsingRegression and Multilevel/Hierarchical Models.CambridgeUniversity Press2Stata 10.0 Manual Longitudinal/Panel Data3Rabe-Hesketh,Sophia and Anders Skrond
2、al.2005.Multileveland Longitudinal Modeling Using Stata.Stata Press2/24What is longitudinal panel data?1Marriage of regression and time-series analysis2A broad cross-section of subjects observed over time3Individuals surveyed repeatedly over time(American NationalElection Study;U.S.Panel Study of In
3、come Dynamics)4Statistics compiled over time for a particular geo-politicalentity(Divorce Rates and welfare rates collected annually fromU.S.States)5Statistics compiled on hospital patients over time3/24Modeling Panel Data(Repeated)cross-sectional regression analysis generates thefollowing modelyit=
4、+xit+?it(1)yit=+x0itB+?it(2)1Heterogeneity or uniqueness of subjects captured in?it2The cross-sectional units(individuals,rms,cities)arerepresented by i3Repeated time units are represented by t4/24Varying Intercept Modelyit=j+xit+?it(3)GroupDGroupCGroupBGroupAYX5/24Varying Slope Modelyit=+jxit+?it(4
5、)GroupCGroupBGroupAGroupDYX6/24Varying Intercepts and Slopes Modelyit=j+jxit+?it(5)GroupCGroupBGroupAYGroupDX7/24Data Preparation in Stata:Australian Smoking Study1data is available athttp:/www.stat.columbia.edu/gelman/arm/2variables:newid(identies each unique respondent)sex(1=female)parsmk(1=parent
6、s smoke)wave(identies eachof 6 waves)smkreg(is respondent regular smoker)8/24.list+-+|newidsex_1_f_parsmkwavesmkreg|-|1.|11010|2.|11020|3.|11040|4.|11050|5.|11060|-|6.|20010|7.|20020|8.|20030|9.|20040|10.|20050|-|11.|20060|12.|31010|13.|31020|14.|31030|15.|31040|-|16.|31050|17.|31060|18.|41010|19.|4
7、1020|20.|41030|-|21.|41040|22.|41050|23.|41060|24.|50010|25.|50020|-|26.|50030|27.|50040|28.|50050|29.|50060|30.|60010|9/24Smoking by Sex over Panel Wavesgirlsboys050100150proportion smokers in population123456wave10/24Modeling the Smoking Longitudinal DataPr(yjt=1)=logit1(0+1psmokejt+2femalejt+(6)3
8、t+4femalejt t+j+?jt),t=1,.Tj,j=1,.,n.(7)j N(,2)(8)11/24Estimation with Gllamm in Stata.use e:Oxford08Department08Trinity_PanelDatagelmansmoke_pub.dta,clear.tsset newid wavepanel variable:newid(unbalanced)time variable:wave,1 to 6,but with gapsdelta:1 unit.gllamm smkreg parsmk wave,i(newid)link(logit
9、)family(binom)12/24Estimation with Gllamm in Statagllamm modellog likelihood=-2074.7563-smkreg|Coef.Std.Err.zP|z|95%Conf.Interval-+-parsmk|1.270422.19982376.360.000.87877461.662069wave|.4195264.036513211.490.000.3479619.4910909_cons|-7.24026.2742149-26.400.000-7.777711-6.702808-Variances and covaria
10、nces of random effects-*level 2(newid)var(1):13.679018(.88531601)-13/24Estimation with Gllamm in Stata:Incorporating Time Trend.gen male_time=wave*(1-sex_1_f).gen female_time=wave*sex_1_f.gen sex_time=wave*sex_1_f.gllamm smkreg parsmk wave sex_time,i(newid)link(logit)family(binom)14/24Estimation wit
11、h Gllamm in Stata:Incorporating Time Trend.gen male_time=wave*(1-sex_1_f).gen female_time=wave*sex_1_f.gen sex_time=wave*sex_1_f.gllamm smkreg parsmk wave sex_time,i(newid)link(logit)family(binom)15/24Estimation with Gllamm in Stata:Incorporating Time Trendnumber of level 1 units=8730number of level
12、 2 units=1760Condition Number=17.565231gllamm modellog likelihood=-2071.4531-smkreg|Coef.Std.Err.zP|z|95%Conf.Interval-+-parsmk|1.314832.22783615.770.000.86828121.761382wave|.3598051.04325298.320.000.275031.4445792sex_time|.10706.04248222.520.012.0237965.1903235_cons|-7.263204.2767673-26.240.000-7.8
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 面板 数据 stata 分析
限制150内