# Re: constraints in xtgls and xtpcse [was: st: QUESTION]

 From Samira Bakhshi To statalist@hsphsun2.harvard.edu Subject Re: constraints in xtgls and xtpcse [was: st: QUESTION] Date Tue, 29 Apr 2008 16:33:48 -0600 (CST)

```I am so thankful for your reply.
Actually, I have a system of panel data equations with 45 constraints.
So imposing these constraints in way you have described would be
difficult. Is not there any other way that Stata accpets the option ,
const () after xtgls?

Thanks,
Samira

Maarten buis wrote:

>> I want to use xtgls or xtpcse commands but I do not know how to
>> impose constraint with these commands.
>> STATA does not allow ,const() option after xtgls command.
>
>First of all, please use informative subject titles. Also Stata, is
>written as Stata and not STATA (it is an invented word not an acronym)
>All this you could and should have read in the Statalist FAQ, a
>reference to which you can find at the bottom of every message on
>statalist.
>
>You can always use the following trick to impose a linear constaint.
>Consider this regression equation:
>
>y = b0 + b1 x1 + b2 x2 + e
>
>If you want to constrain b1 equal to b2, you can just as well write:
>
>y = b0 + b1 x1 + b1 x2 + e
>  = b0 + b1 (x1 + x2) + e
>
>So, if you create a variable which is the sum of x1 and x2, and add
>this variable to your model instead of x1 and x2, then the parameter of
>this `sum variable' is the parameter when you constrain the effects of
>x1 and x2 to be equal.
>
>Using the same logic you can also impose other linear constraints.
>
>-- Maarten
>
>
>
>-----------------------------------------
>Maarten L. Buis
>Department of Social Research Methodology
>Vrije Universiteit Amsterdam
>Boelelaan 1081
>1081 HV Amsterdam
>The Netherlands
>
>Buitenveldertselaan 3 (Metropolitan), room Z434
>
>+31 20 5986715
>
>http://home.fsw.vu.nl/m.buis/
>-----------------------------------------
>
>
>      __________________________________________________________
>Sent from Yahoo! Mail.
>A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
>*
>*   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/
>
*
*   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/
```