Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: the xi: command

From   Ulrich Kohler <[email protected]>
To   [email protected]
Subject   Re: st: the xi: command
Date   Thu, 4 Jul 2002 11:53:09 +0000

> I am using the xi: command to construct dummy variables from categorical
> variables. My problem is that I would like the xi-command to not remove one
> of the dummies but I cannot in the manual find a command that turns this
> characteric off. Is it possible to keep all the dummy variables, or have I
> for the first time in my life found a limitation in a Stata command?

If you consider this as a limitation, the answer is yes, I think so. But if 
you only dealing with dummies you can use the gen()-option of the -tabulate- 
command instead. For example the command

.. tab v1, gen(v1d)

produces dummies v1d1, v1d2, ... v1dk for the categorical variable v1. This 
is faster than -xi- and allows more control over variable names. 

.. quietly tab v1, gen(v1d)

supresses the output, if you don't want to see it.  With

foreach var of varlist v1-v100 {
     quietly tab `var', gen(`var'd)

you produce dummies for variable lists.


*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index