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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Labelling of categorical variables in regression outputs


From   daniel klein <klein.daniel.81@googlemail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Labelling of categorical variables in regression outputs
Date   Mon, 18 Jun 2012 17:54:19 +0200

Amal,

-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_.

Best
Daniel

-- 
[...]
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:
*   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