Bookmark and Share

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/estout losing variable labels when dataset changes


From   Daniel Gross <[email protected]>
To   statalist <[email protected]>
Subject   st: esttab/estout losing variable labels when dataset changes
Date   Fri, 31 Jan 2014 01:04:39 -0800

Dear Statalist,

I'm trying to store estimation results across several regressions
using the eststo command and later write them to tables using esttab
or estout -- my intention is to fully separate the code that runs my
regressions from the code that makes the tables.

The problem is that the dataset changes between regressions, and
esttab doesn't seem to be retaining the variable labels from the
dataset each stored regression was actually run on: all the variables
come out unlabeled in my tables, despite using the "label" option and
having labeled variables at the time each regression is run. When I
move the table-making code to immediately after the relevant
regression, and write the table before changing the dataset, the
variable labels show up.

As a shot in the dark I've tried adding varlabels(`e(labels)') as an
option to esttab but no luck (which I think is expected, because e()
changes with each estimation anyway, right?).

Here's an example of an esttab command I might run:
esttab sim_lev_0 sim_lev_1 sim_lev_2 using "$tabs/table_lev.tex", replace ///
cells(b (star fmt(3)) se(par fmt(3) abs)) starlevels(* 0.1 ** 0.05 *** 0.01) ///
stats(N r2, fmt(%9.0f %9.2f) labels("N" "\$R^2$")) ///
nomtitles eqlabels(none) collabels(,none) label ///
addnote("`footnotes'") substitute(_ \_ LatexMath \$) ///
varlabels(`e(labels)')

Does anyone know if it's possible to retain variable labels attached
to estimation results when the dataset is changed or cleared? Thank
you in advance!

Daniel
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index