Hi Stata ninjas,
I am using estout documentation to develop a table that includes the coefficients from about ~80 "observational experiments" created using teffects nnmatch
I follow the instructions here http://repec.org/bocode/e/estout/hlp...html#varlabels (you can use Ctrl F and type: "Approach 2: Again run esttab or estout" to find the spot in the documentation.
It provides the following .do file
when I run this same file except for a teffects command the system produces a name for the coefficient name that will not be processed because it has both symbols and numbers in it. The other reason it might not be accepting the name of the row is they are all the same.
because the output of the ATE regression looks like this when it is batched by esttab and even if i write rename command; it will run the regression but ignores the command.
if anyone can point me in the right direction i would be so grateful for the amount of time it will save : )
I am using estout documentation to develop a table that includes the coefficients from about ~80 "observational experiments" created using teffects nnmatch
I follow the instructions here http://repec.org/bocode/e/estout/hlp...html#varlabels (you can use Ctrl F and type: "Approach 2: Again run esttab or estout" to find the spot in the documentation.
It provides the following .do file
sysuse auto
eststo model1: quietly reg price weight
eststo model2: quietly reg price weight mpg
esttab, se nostar
matrix C = r(coefs)
eststo clear
local rnames : rownames C
local models : coleq C
local models : list uniq models
local i 0
foreach name of local rnames {
local ++i
local j 0
capture matrix drop b
capture matrix drop se
foreach model of local models {
local ++j
matrix tmp = C[`i', 2*`j'-1]
if tmp[1,1]<. {
matrix colnames tmp = `model'
matrix b = nullmat(b), tmp
matrix tmp[1,1] = C[`i', 2*`j']
matrix se = nullmat(se), tmp
}
}
ereturn post b
quietly estadd matrix se
eststo `name'
}
esttab, se mtitle noobs
eststo clear
eststo model1: quietly reg price weight
eststo model2: quietly reg price weight mpg
esttab, se nostar
matrix C = r(coefs)
eststo clear
local rnames : rownames C
local models : coleq C
local models : list uniq models
local i 0
foreach name of local rnames {
local ++i
local j 0
capture matrix drop b
capture matrix drop se
foreach model of local models {
local ++j
matrix tmp = C[`i', 2*`j'-1]
if tmp[1,1]<. {
matrix colnames tmp = `model'
matrix b = nullmat(b), tmp
matrix tmp[1,1] = C[`i', 2*`j']
matrix se = nullmat(se), tmp
}
}
ereturn post b
quietly estadd matrix se
eststo `name'
}
esttab, se mtitle noobs
eststo clear
when I run this same file except for a teffects command the system produces a name for the coefficient name that will not be processed because it has both symbols and numbers in it. The other reason it might not be accepting the name of the row is they are all the same.
eststo clear
eststo: teffects nnmatch (percentageafd ln_jekm ln_inc_per turnout) (hj_hb)
eststo: teffects nnmatch (percentageafd ln_jekm ln_inc_per turnout) (hj_hb)
eststo: teffects nnmatch (percentageafd ln_jekm ln_inc_per turnout) (hj_hb)
esttab, se nostar r2
matrix C = r(coefs)
eststo clear
local rnames : rownames C
local models : coleq C
local models : list uniq models
local i 0
foreach name of local rnames {
local ++i
local j 0
capture matrix drop b
capture matrix drop se
foreach model of local models {
local ++j
matrix tmp = C[`i', 2*`j'-1]
if tmp[1,1]<. {
matrix colnames tmp = `model'
matrix b = nullmat(b), tmp
matrix tmp[1,1] = C[`i', 2*`j']
matrix se = nullmat(se), tmp
}
}
ereturn post b
quietly estadd matrix se
eststo `name'
}
. esttab, se mtitle noobs
eststo: teffects nnmatch (percentageafd ln_jekm ln_inc_per turnout) (hj_hb)
eststo: teffects nnmatch (percentageafd ln_jekm ln_inc_per turnout) (hj_hb)
eststo: teffects nnmatch (percentageafd ln_jekm ln_inc_per turnout) (hj_hb)
esttab, se nostar r2
matrix C = r(coefs)
eststo clear
local rnames : rownames C
local models : coleq C
local models : list uniq models
local i 0
foreach name of local rnames {
local ++i
local j 0
capture matrix drop b
capture matrix drop se
foreach model of local models {
local ++j
matrix tmp = C[`i', 2*`j'-1]
if tmp[1,1]<. {
matrix colnames tmp = `model'
matrix b = nullmat(b), tmp
matrix tmp[1,1] = C[`i', 2*`j']
matrix se = nullmat(se), tmp
}
}
ereturn post b
quietly estadd matrix se
eststo `name'
}
. esttab, se mtitle noobs
because the output of the ATE regression looks like this when it is batched by esttab and even if i write rename command; it will run the regression but ignores the command.
if anyone can point me in the right direction i would be so grateful for the amount of time it will save : )
Comment