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)'
Code:
r(vif_3)
Code:
estat vif
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.
0 Response to Exporting multiple VIFs to excel
Post a Comment