Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: esttab or estout table format
From
Nina Brooks <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: esttab or estout table format
Date
Wed, 5 Mar 2014 16:38:16 +0000
Hi,
I have been working with the code on
http://www.stata.com/statalist/archive/2009-01/msg01084.html to export a
table of regression results with rows for every coefficient on treatment
status for about 15 different models. For some reason, esttab is not
exporting the stars for significance. I have specified the star option and
when esttab reports results within the results window, significant
coefficients have stars but as soon as it exports
to .csv, significance is no longer indicated.
My code is below:
** full sample
mat drop C
eststo clear
foreach var of global outcomes {
eststo `var': reg `var' treatment if R2 == 0, cl(grp_code) r
}
esttab, nocons not star ml("") noobs l
mat C = r(coefs)
mat list C
local rnames : rownames C
local models : coleq C
local models : list uniq models
foreach name of local rnames {
local j 0
cap mat drop b
foreach model of local models {
loc ++j
mat tmp = C[1, 2*`j'-1]
if tmp[1,1] !=. {
mat colnames tmp = `model'
mat b = nullmat(b), tmp
}
}
ereturn post b
eststo `name'
}
esttab treatment using Table2.csv, noobs not star nocons mtitle b(a3)
varwidth(30) replace plain
I am also trying to get results for several sub-groups into this same
table, but cannot figure out how to add additional columns for those
results, when I use the append option it stacks each model on below the
previous model, rather than side by side
as the default does.
Thanks,
Nina
Nina Brooks
Candidate for MPP, Class of 2014
Duke University, The Sanford School of Public Policy
Tel +1.213.272.3395
[email protected]
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/