After running some regressions followed by postestimation commands, I would like to export some store results to excel using the -putexcel- command. I am doing this for different specifications.
Take the simple example below.
The only thing that changes in the -putexcel- commands after the estimations is the name of file (which is also the name of one of the columns): ESTIMATION1, ESTIMATION2, ....
I would like to write a program with such name (eg "ESTIMATION1") as an argument. I would then call this program after each estimation with the name of the file to be saved. Would anyone be able to help? Thank you.
Take the simple example below.
Code:
ssc install weakivtest sysuse auto, clear ivreg2 price (weight=length foreign) i.turn, cluster(turn) small weakivtest putexcel set "ESTIMATION1", modify putexcel B1 = "ESTIMATION1" putexcel A2 = "KP F-stat" putexcel B2 = (e(rkf)) putexcel A3 = "Effective F-stat" putexcel B3 = (r(F_eff)) ivreg2 price (weight=gear_ratio foreign) i.turn, cluster(turn) small weakivtest putexcel set "ESTIMATION2", modify putexcel B1 = "ESTIMATION2" putexcel A2 = "KP F-stat" putexcel B2 = (e(rkf)) putexcel A3 = "Effective F-stat" putexcel B3 = (r(F_eff))
I would like to write a program with such name (eg "ESTIMATION1") as an argument. I would then call this program after each estimation with the name of the file to be saved. Would anyone be able to help? Thank you.

Comment