Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • xtabond2 replication exercise - what am I doing wrong?

    Hi, I've been trying to replicate a dynamic panel regression run by Spilimbergo in his 2009 AER paper on democracy and foreign education. Luckily, AER is quite transparent and Spilimbergo dataset is published together with the paper

    Paper: http://pubs.aeaweb.org/doi/pdfplus/10.1257/aer.99.1.528

    I managed to replicate pooled OLS regression and fixed effects

    ******CODE*******
    copy https://www.aeaweb.org/aer/data/mar09/20061180_data.zip 20061180_data.zip
    unzipfile 20061180_data.zip

    use "AERdata_Democracy.dta", clear
    de fhpolrigaug fstu s_fhp

    recode indi (-43/4=0)(5/max=1), gen(include)
    encode country, gen(country_numeric)

    tsset country_numeric year
    sort country_numeric year
    tab year, gen (yr)
    tab country, gen(ctry)

    **Pooled OLS (Model 1 in Table 1A)
    reg fhpolrigaug L5.(fhpolrigaug c.fstu##c.s_fhp) yr* if include==1, cluster(country_numeric)
    **Fixed effects (Model 2 in Table 1A)
    xi: xtreg fhpolrigaug L5.(fhpolrigaug c.fstu##c.s_fhp) yr* if include==1, fe robust cluster(country_numeric)
    ******END*******

    However, I am struggling to with replicating dynamic panel regression model (3 in Table 1A). I should be using xtabond2 command, Spilimbergo specified that students abroad (fstu), democracy in host countries(s_fhp), and all other control variables (he adds other variable later on but I just want to replicate the basic model) excluding time fixed effects are treated as predetermined and are instrumented for using their own first to third lags in level and difference

    I tried this but clearly I must be doing something wrong - I would be very grateful for any hints or comments
    ******CODE*******
    copy https://www.aeaweb.org/aer/data/mar09/20061180_data.zip 20061180_data.zip
    unzipfile 20061180_data.zip

    use "AERdata_Democracy.dta", clear
    de fhpolrigaug fstu s_fhp

    recode indi (-43/4=0)(5/max=1), gen(include)
    encode country, gen(country_numeric)

    tsset country_numeric year
    sort country_numeric year
    tab year, gen (yr)
    tab country, gen(ctry)

    ****I found this foud on Stata forum, after tsset country_numeric year xtabond2 returned no observations***
    gen time2 =.

    replace time2 = 1 if yr1 == 1
    replace time2 = 2 if yr2 == 1
    replace time2 = 3 if yr3 == 1
    replace time2 = 4 if yr4 == 1
    replace time2 = 5 if yr5 == 1
    replace time2 = 6 if yr6 == 1
    replace time2 = 7 if yr7 == 1
    replace time2 = 8 if yr8 == 1
    replace time2 = 9 if yr9 == 1
    replace time2 = 10 if yr10 == 1
    replace time2 = 11 if yr11 == 1
    replace time2 = 12 if yr12 == 1
    tab time2, gen (t2)

    tsset country_numeric time2

    xtabond2 fhpolrigaug L.fhpolrigaug L(1/3).(c.fstu##c.s_fhp) t2* if include==1, gmm(L.fhpolrigaug) iv (L(1/3).(c.fstu##c.s_fhp)) twostep robust
    ******END*******

    Click image for larger version

Name:	Screen Shot 2015-08-10 at 12.33.17.png
Views:	2
Size:	292.5 KB
ID:	1305522
    Attached Files
Working...
X