Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: problems with xi3


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: problems with xi3
Date   Tue, 15 Apr 2008 11:01:31 +0100 (BST)

--- "E. Michael Foster" <[email protected]> wrote:
> I'm trying to impose the normalizing constraint on a set of dummy
> variables representing a set of mutually exclusive categories.
> A common identification constraint is to set the sum of the dummies
> to zero. 

This constraint is sometimes referred to as effect coding, and is
already implemented in -xi3- so you do not need to add a user defined
contrast. When you do that, the results from a model using your
manually created variables correspond to the results from a model using
the variables created by -xi3-. See the example below:

*-------------- begin example ----------------
sysuse auto, clear

sort mpg
gen mpgg=group(3)
xi i.mpgg, prefix(D)
for var D*: replace X=-1 if mpgg==1
regress weight D*

xi3: reg weight e.mpgg
*------------- end example -------------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      ___________________________________________________________ 
Yahoo! For Good helps you make a difference  

http://uk.promotions.yahoo.com/forgood/
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index