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]

Re: st: Labelling of categorical variables in regression outputs

From   daniel klein <>
Subject   Re: st: Labelling of categorical variables in regression outputs
Date   Mon, 18 Jun 2012 17:54:19 +0200


-xi- is the predecessor of Stata's factor variable notation introduced
in Stata 11. The problem here is, that neither -xi- nor factor
variables may have labels attached (yet). You need to work around
this, creating the dummies yourself.

Here is one way, using Nick Cox's -labvarch-, part of his -labutil-
package, available from SSC (type -ssc inst labutil-).

ta motherland ,g(moth_)
labvarch moth_* ,aft(==)

regress wt_gain moth_* malder if multibirth==2

This approach assumes there are no other variables in your dataset
having names that begin with moth_.


I labelled my exposure variable as follows:

label variable motherland "mother's country of birth"
label define motherland 1 "Sweden" 2 "Western Europe + NA" 3 "Finland"
4 "Eastern Europe" 5 "Poland" 6 "F. Yugoslavia" 7 "Arab league" 8
"Iraq" 9 "Lebanon" 10 "Somalia" 11 "Syria" 12 "Turkey" 13 "Iran" 14
"South Asia" 15 "Ethiopia+Eritrea" 16 "East asia" 17 "Latin America"
18 "Chile" 19 "Africa"
label values motherland motherland

eststo xi: regress wt_gain i.motherland malder if multibirth==2
*   For searches and help try:

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