Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Two way table of regression coefficients or intercepts with -esttab-

From   Richard Herron <[email protected]>
To   [email protected]
Subject   st: Two way table of regression coefficients or intercepts with -esttab-
Date   Fri, 23 Sep 2011 09:58:58 -0400

Can I make a two-way table of regression coefficients with -esttab-?
Sometimes I like to make a two-way table with either intercepts or
coefficients and I would like to automate it.

For example, here I generate three random variables, then form
quintiles on -a- and -b-, then find the mean of -c- in each of the 25
groups (intersections of -a_q- and -b_q-) with -regress-. This is
fairly easy with -table-, but is less extensible to displaying
intercepts, significance, etc (and I am not sure how to generate a
LaTeX table from -table-). Can I so this with -esttab- or -estout-?


* --- begin code ---

* generate data
set obs 2000
generate a = rnormal()
generate b = rnormal()
generate c = rnormal()

* generate quantiles for for a and b
xtile a_q = a, nquantiles(5)
xtile b_q = b, nquantiles(5)

* I would like something like this two-way table of means, but that is
extensible to intercepts and/or more coefficients
table a_q b_q, c(mean c)

* but the best I can do is this very wide table that is not very readable
eststo clear
bysort a_q b_q: eststo: quietly regress c
esttab, not noconstant nogap compress

* --- end code ---
*   For searches and help try:

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