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

Re: st: dummy variables with desmat


From   John Hendrickx <john_hendrickx@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: dummy variables with desmat
Date   Fri, 20 Aug 2004 02:58:12 -0700 (PDT)

Desmat creates dummy variables for variables and interactions without
checking whether any of these are duplicates. Desmat then uses the
Stata command _rmcoll to delete the duplicates. Desmat doesn't
renumber the dummies, desrep prints descriptive labels anyway. Which
particular dummies are dropped is determined by _rmcoll. It usually
deletes the second and subsequent duplicates but it can also drop
highly collinear (dummy) variables (and that's actually what it's
for).

If you use the option "defcon(dir)" then all the variables in your
model will be treated as continous. Whether or not you specify this
option should strongly affect your model and the desmat output. The
"desrep(all)" option on the other hand determines which statistics
are printed. It shouldn't affect which dummies are dropped.

I'd suggest running desmat using the "colinf" option. It will tell
you which dummies have been dropped, maybe that will help. For use in
a loop, you might want to use desmat  as a standalone command to
create dummies, then using "renpfix _x_ _z_". Then you can use _z_*
in subsequent models using desmat as a prefix command and adding
whatever extra terms you want. Something like

desmat var1 var2 varn
renpfix _x_ _z_
desmat: logistic y _z_* new1
desmat: logistic y _z_* new2

Hope this helps,
John Hendrickx

--- Tim Wade <wade_tj@yahoo.com> wrote:

> Hello Statalisters:
> 
> I have recently been using John Henrickson's excellent
> and much needed "desmat" program for some logistic
> regressions. When I run a model with over 10 or so
> variables, together with either the desrep(all) or the
> defcon(dir) options, the order of the dummy variables
> (_x_1 _x_2, etc.) created changes from the order in
> which they were specified in the model. If I do not
> use either the desrep or the defcon options, the order
> of the dummy variables created is the same as the way
> I specified the model. In other words, the dummy
> variable represented by the second term is no longer
> _x_2. This is troubling because I am trying to
> automate a loop to run the same linear combinations
> with every model while controlling for different
> factors. Is this a feature of the command? If so, why
> does the order of these variables change.
> 
> Thanks very much for any insights, Tim
> 
> 
> =====
> wade_tj@yahoo.com
> 
> 
> 		
> _______________________________
> Do you Yahoo!?
> Win 1 of 4,000 free domain names from Yahoo! Enter now.
> http://promotions.yahoo.com/goldrush
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index