Announcement

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

  • Panel Var IRF

    Dear All,
    I'm running panel var on two datasets and i want to compare their irf graphs. i want to put the IRFs of both regressions togther in the same file to compare them. but i can't find any option in pvarirf command to help me to put both IRFs together. any help?

  • #2
    You can open *.irf files, merge them, and then graph the results. For example:

    Code:
    clear*
    webuse lutkepohl2
    var dln_inv dln_inc
    irf create irf1, set(irf1, replace)
    irf graph oirf, impulse(dln_inv) response(dln_inc) name(orig1,replace)
    var dln_inv dln_consump
    irf create irf2,  set(irf2,replace)
    irf graph oirf, impulse(dln_inv) response(dln_consump) name(orig2, replace)
    
    use "irf2.irf",clear
    keep if impulse == "dln_inv" & response == "dln_consump"
    keep step oirf stdoirf
    gen upper_ci2 = oirf +1.96*stdoirf 
    gen lower_ci2 = oirf - 1.96*stdoirf
    rename oirf oirf2
    save irf2_data,replace
    
    use "irf1.irf"
    keep if impulse == "dln_inv" & response == "dln_inc"
    keep step oirf stdoirf
    gen upper_ci1= oirf +1.96*stdoirf 
    gen lower_ci1 = oirf - 1.96*stdoirf
    rename oirf oirf1
    merge 1:1 step using irf2_data
    twoway rarea upper_ci1 lower_ci1 step, color(blue%20) lwidth(vvthin)  /// 
        || line oirf1 step , lc(blue) /// 
        || rarea upper_ci2 lower_ci2 step, color(green%20) lwidth(vvthin)  /// 
        || line oirf2 step , lc(green) /// 
        ||, legend(pos(6) row(1) order(2 "IRF1-Income" 4 "IRF2-Consumption"))
    Click image for larger version

Name:	Graph1.png
Views:	1
Size:	58.0 KB
ID:	1492749

    Comment

    Working...
    X