Hi!

I have a question regarding regression output I would like to get as efficiently as possible. I want 18 regressions that use the same dependent and independent variables. Also, the fixed effects are the same. In this case I want to split the sample up in three levels of KZ, negative and positive cash flows and young and mature firms. I show the codes for these variables below. This way I want to create one row with all cash flows, one with positive and one with negative. Each column represents the level of KZ and these columns are split up in young and mature firms.

The last part of the code shows a loop for the KZ levels already but I don't know how I can split these again.

Thanks in advance!

Code:
g negcf=0
replace negcf=1 if cf<0

bysort gvkey: egen firstyear=min(fyear)
g firmage=fyear-firstyear
g youngfirm=0
replace youngfirm=1 if firmage<10

bysort gvkey: egen group_median=median(KZ)
gquantiles q3_KZ = group_median, xtile nquantiles(3)

levelsof q3_KZ, local(groups)
foreach group of local groups {
eststo: quietly reghdfe rd L1.tobin icf if q3_KZ==`group', absorb(fyear sic gvkey) cluster(gvkey)
}