Dear all,
I'm currently struggling with an output I'm trying to create from an IV regression. I try to make up a table from the first stage of my IV regression. Furthermore, I also get the output I'm searching for. BUT: I used bysort in combination with eststo so get my output for several groups, and I'm not able to find the right code to create a table with esttab out of the grouped values. Please find my modified code attached. Thank you!
bysort groupe_name: eststo m1: ivreghdfe variable_1 controls (IV_variable= IV_regressors), first savefirst savefprefix(s1) absorb(cluster_variables) tol(1e-6)
estadd scalar cdf1 = `e(cdf)': s1variable_1
estadd scalar sstat1 = `e(sstat)': s1variable_1
qui reg `e(instd)' `e(insts)' if e(sample)
local r2a= e(r2_a)
est restore m1
estadd scalar r2a = `r2a': s1variable_1
esttab s1variable_1 using title.tex, replace ///
stats(cdf1 sstat1 r2a , labels("CD Wald F" "SW S stat." "Adj. R2" )) ///
indicate("Controls= controls" `r(indicate_fe)') ///
compress star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N) b(4) ///
label title(with cooking fuel) ///
nonumbers mtitles("variable_1" ) nodepvar nonumber
I'm currently struggling with an output I'm trying to create from an IV regression. I try to make up a table from the first stage of my IV regression. Furthermore, I also get the output I'm searching for. BUT: I used bysort in combination with eststo so get my output for several groups, and I'm not able to find the right code to create a table with esttab out of the grouped values. Please find my modified code attached. Thank you!
bysort groupe_name: eststo m1: ivreghdfe variable_1 controls (IV_variable= IV_regressors), first savefirst savefprefix(s1) absorb(cluster_variables) tol(1e-6)
estadd scalar cdf1 = `e(cdf)': s1variable_1
estadd scalar sstat1 = `e(sstat)': s1variable_1
qui reg `e(instd)' `e(insts)' if e(sample)
local r2a= e(r2_a)
est restore m1
estadd scalar r2a = `r2a': s1variable_1
esttab s1variable_1 using title.tex, replace ///
stats(cdf1 sstat1 r2a , labels("CD Wald F" "SW S stat." "Adj. R2" )) ///
indicate("Controls= controls" `r(indicate_fe)') ///
compress star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalars(N) b(4) ///
label title(with cooking fuel) ///
nonumbers mtitles("variable_1" ) nodepvar nonumber

Comment