Dear Statalisters,

I am running a large amount of regressions analyses (specifically 4 models separately for 39 countries). I am looking to export VIF-statistics from each model to excel for the purpose of creating a table reporting VIFs. Each row should represent a country and each column a predictor variable.
I am only concerned with the VIFs of my primary predictor variables (i.e. not VIFs of my control variables).

This is the code I've been using so far:

Code:
forvalues i = 1(1)39 {

putexcel set myexcelsheet.xls, sheet(VIF) modify

quietly: reg y control1 control2 predictor1 predictor2 predictor3 if country==`i'

estat vif
putexcel A`i'=`r(vif_3)'
putexcel B`i'=`r(vif_4)'
putexcel C`i'=`r(vif_5)'
What I thought was that
Code:
 r(vif_3)
would represent the third independent variable in my model. However, the problem is that
Code:
estat vif
orders the VIF-statistics from highest to lowest. So effectively I only get the three lowest VIF-statistics, regardless of which variable they represent.
Just taking all of them is not an option either as again i wouldn't know which VIF-statistic represent which variable.

Essentially what I am asking is whether anyone has an idea for a solution that would allow me to only put VIF-statistics for specific variables to excel.

Thank you for your help.