Announcement

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

  • Merging Different VIF Tables for Pooled-Time Series Models

    Dear friends,

    I have six different regression columns, measuring the determinants of foreign aid flows from major European donors. I checked for multicollinearity for each time-series pooled regression model. Indeed, I want to create six different VIF tables for each regression model. Here, I provide what I want to do. Instead of providing six different VIF estimates separately, I want to merge them into one table.

    Is there a way to merge them as below? I couldn't do it. I provide an example of two different multicollinearity checks.

    Code:
    reg logukdac2a L.logukdac2a muslim L.unchn L.logtopsevenoda l.logukexport L.logtopsevenexport , vce(cluster iso)
    vif
    eststo vif1
    reg logfrancedac2a L.logfrancedac2a muslim L.unchn L.logtopsevenoda l.logfranceexport L.logtopsevenexport , vce(cluster iso)
    vif
    eststo vif2
    esttab vif1 vif2  using viftables.tex

  • #2
    There are no matrices left behind by estat vif, so you have to build them from the stored results in r(). estout is from SSC as you are asked to explain (FAQ Advice #12).

    Code:
    cap program drop makemat
    program makemat, eclass
    mat wanted= J(`=e(rank)-1', 1, .)
    local rownames
    forval i=1/`=e(rank)-1'{
        mat wanted[`i', 1]=`=r(vif_`i')'
        local rownames "`rownames' `=r(name_`i')'"
     }
    mat rownames wanted = `rownames'
    estadd mat wanted= wanted'
    end
    
    sysuse auto, clear
    regress mpg weight disp turn
    estat vif
    makemat
    est sto m1
    regress price weight disp turn headroom gear
    estat vif
    makemat
    est sto m2
    
    esttab m*, cells("wanted") collab(none) title(Variance inflation factors)


    Res.:

    Code:
    . esttab m*, cells("wanted") collab(none) title(Variance inflation factors)
    
    Variance inflation factors
    --------------------------------------
                          (1)          (2)
                          mpg        price
    --------------------------------------
    weight           7.533863     7.635791
    displacement     5.029553     6.917704
    turn             3.782949      3.79982
    gear_ratio                    3.230168
    headroom                      1.323111
    --------------------------------------
    N                      74           74
    --------------------------------------

    Comment


    • #3
      Dear Andrew Musau ,

      I ran my own codes, and it worked very well.

      Thank you so much,

      Best,

      Comment

      Working...
      X