Statalist


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

st: value labels when using factor variables


From   "Paul Shattuck" <[email protected]>
To   <[email protected]>
Subject   st: value labels when using factor variables
Date   Thu, 24 Sep 2009 13:15:55 -0500

I am running regression models using Stata's factor variable option
(i.varname) to automatically create dummy variables for categorical
predictors <very cool feature>. However, the coefficient row labels in
the regression model output do not contain the value labels from the
original categorical variable. This makes it difficult to automate table
production using estout or other methods. Does anyone know how to use
the factor variable option AND have the factor variables be labeled with
the category value labels from the original categorical variable the
dummies were derived from?

For instance, if I run a regression on a dependent variable ("depvar")
and a 5-category predictor variable for poverty level ("pov") where the
value labels are defined as 1 "Below 100% FPL" 2 "100-150% FPL" 3
"150-200% FPL" 4 "200-300% FPL" and 5 "Over 300% FPL":

regress depvar i.pov

Then my regression output is labeled like this, with none of the value
labels from "depvar" being carried over into the final regression table
labels.

------------------------------------------------------------------------
-----------------
depvar	|	Coef.		Std. Err. 		t
------------------------------------------------------------------------
-----------------
     pov	|	<blank>
	2	|	<b>
	3	|	<b>
	4	|	<b>
	5	|	<b>
		|
   _cons	|
------------------------------------------------------------------------
-----------------


What I would like to end up with is this:


------------------------------------------------------------------------
-----------------
depvar		|	Coef.		Std. Err. 		t
------------------------------------------------------------------------
-----------------
Below 100% FPL	|	<blank>
100-150% FPL	|	<b>
150-200% FPL	|	<b>
200-300% FPL	|	<b>
Over 300% FPL	|	<b>
			|
   _cons		|
------------------------------------------------------------------------
-----------------






Thank you,

Paul T. Shattuck, Ph.D.



*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index