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: Useful labelling of dummy variables following logit

From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: Useful labelling of dummy variables following logit
Date   Wed, 24 Aug 2011 14:16:51 +0200

On Wed, Aug 24, 2011 at 1:22 PM, Tim Evans wrote:
> Thanks for your help. I guess what I'm after is the labelling of the dummy variables when printed in the output table. I couldn't get dummieslab to work very well on the example using the auto data - I got this error message:
> sysuse auto
> (1978 Automobile Data)
> label define newfor 0 "Domestic car" 1 "Foreign (European or Japanese) car"
> label values foreign newfor
> dummieslab foreign
> dummieslab foreign, word(1)
> dummieslab foreign, word(-1)
> implied variable names contain duplicates
> r(498);

That makes sense: In the last the last call to -dummieslab, you are
asking the names of the variables to come from the last word of each
value label. In this case that is for each category the word "car".
You cannot create two variables with the same name, so it should exit
with an error, which it does.

> Even after this works, I'm not sure this would follow through to the table.

In the output table you see the names of the variables, as the names
of the variables now somewhat correspond to the value labels, you now
get closer to what you want. It may still look horrible because
variable names may not contain characters like "(" or " " or when the
names are very long. If that is too big a problem for you, than there
is no other option than to create and name the dummy variables
yourself. That way you can fine tune the names to represent the
balance between clarity and length of the name.

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
*   For searches and help try:

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