Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

re: st: AW: Labeling variable values in Regression Tables


From   Christopher Baum <kit.baum@bc.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   re: st: AW: Labeling variable values in Regression Tables
Date   Thu, 10 Jun 2010 12:02:37 -0400

<>
Thomas said
Is anyone familiar with a way to have the values of the categorical
independent variables show up in regression tables?  For instance, for
the variable agegrp, I'd like to see the value of 2 show up as "45-54",
3 as "55-64", 4 as "65-74", and so on.

---------------
// attach a label to auto rep78 for illustrative purposes
label drop rr
label def rr 1 poor 2 fair 3 avg 4 good 5 great
label val rep78 rr

// extract the label texts and build the coeflabels list
lab l rr
forv i=1/`r(max)' {
	loc l: label rr `i'
	loc ll "`ll'  `i'.rep78 `l'"
}

// eststo, esttab from Ben Jann's estout package on SSC
eststo clear
eststo: reg price i.rep78
esttab, drop(1b.rep78) coeflabels(`ll')
-------------------



Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
                              An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
   An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index