Originally posted by Kyle Smith
View Post
Code:
webuse grunfeld, clear local i 0 foreach period in 1940,1940 1954,1954 { regress invest mvalue if inrange(year,`period') local opt= cond(`i'==0, "replace", "append") outreg2 using myfile.xls, `opt' addtext(StartYear, "`=substr("`period'", 1, 4)'",EndYear, "`=substr("`period'", -4, 4)'") excel local ++i }
Comment