Hi,
I have a forval and if loop that together loop over multiple regressions with 55 different conditions, exporting the results through a temporary frame to a large excel table. I am using the reghdfe package, as reg has proven too slow for the clusters and fixed effects that I have incorporated in the regression models.
I want to automatically add an asterisks or other marker to regression results that are significant at the 0.1 level. However, the only way I have found to do this is through the outreg command, which doesn't seem to work in this format. Here is an example of the loop with two regression models. `"`condition`c''"' designates an alternating local condition.
I would appreciate any help on this issue, thank you.
I have a forval and if loop that together loop over multiple regressions with 55 different conditions, exporting the results through a temporary frame to a large excel table. I am using the reghdfe package, as reg has proven too slow for the clusters and fixed effects that I have incorporated in the regression models.
I want to automatically add an asterisks or other marker to regression results that are significant at the 0.1 level. However, the only way I have found to do this is through the outreg command, which doesn't seem to work in this format. Here is an example of the loop with two regression models. `"`condition`c''"' designates an alternating local condition.
Code:
forval c= 1/54{
capture noisily: corr var1 var2 if `condition`c''
if inlist(c(rc), 2000,2001){
frame frame1: replace Variable1= "Insufficient Observations" in `c'
frame frame1: replace Conditions= `"`condition`c''"' in `c'
}
if c(rc)==0{
frame frame1: replace Variable1= word("`:colnames r(C)'", 1) in `c'
frame frame1: replace Variable2= word("`:colnames r(C)'", 2) in `c'
frame frame1: replace Conditions= `"`condition`c''"' in `c'
corr var1 var2 if `condition`c''
frame frame1: replace Corr= r(rho) in `c'
reghdfe var1 var2 if `condition`c'' , ab (i.yearmoed) vce(cluster semelmos)
frame frame1: replace Reg_YearFE= e(b)[1,1] in `c'
frame frame1: replace Std_Err_YearFE= r(table)[2,1] in `c'
reghdfe var1 var2 if `condition`c'' , ab (i.sheelon) vce(cluster semelmos)
frame frame1: replace Reg_SheelFE= e(b)[1,1] in `c'
frame frame1: replace Std_Err_SheelFE= r(table)[2,1] in `c'
}
}
frame change frame1
cd"C:\Users\User\Documents\Research\School Project\Results\Tables and Output\Result_tables"
export excel using results.xls, replace keepcellfmt firstrow(var)
frame change default
frame drop frame1

Comment