Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: How to compose constraint with a series of variables?
From
Maarten buis <[email protected]>
To
[email protected]
Subject
Re: st: How to compose constraint with a series of variables?
Date
Mon, 21 Mar 2011 09:14:15 +0000 (GMT)
--- On Sat, Mar 19, 2011 at 9:20 PM, Muyang Zhang wrote:
> I wish to set constraints in regression. I know usually
> it can be implemented by the -constraint- command. But
> my problem is that I have a series of variables (over
> 1000) starting with the same phrase followed by numbers.
> How can I compose constraints with -*- operator?
> I am only imposing one constraint: the sum of those
> variables is 0.
Sounds like you have a categorical variable and you want
to include that as a set of dummies that do not have a
single category as the reference category but instead
compares each category to the grand mean (which is you
can get by constraining the sum of the effects to be 0).
The easiest way to do so is not use constraints but to
us -xi3- instead (to find it type in Stata -findit xi3-).
The coding you want is called effect coding.
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* 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/