Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: imposing cross-equation constrains with nlsur

 From ABDUL ADAM To "statalist@hsphsun2.harvard.edu" Subject Re: st: imposing cross-equation constrains with nlsur Date Wed, 8 Jun 2011 02:31:47 -0700 (PDT)

```Dear Brian,

Thank you very much. Now because of your help I can account for homogeneity and adding up constraints. But my problem is how can I go about accounting for Symmetry. I have also tried testnl to test for symmetry but I was not sure what to do with the parameters where I fail to reject the null hypothesis. I am thinking to remove those parameters in my elasticity calculations but I am not sure. Please help clarify.
Best Regards,

----- Original Message -----
From: Brian P. Poi <brian@poiholdings.com>
To: statalist@hsphsun2.harvard.edu
Cc:
Sent: Wednesday, June 8, 2011 2:19 AM
Subject: Re: st: imposing cross-equation constrains with nlsur

On 06/07/2011 02:32 PM, ABDUL ADAM wrote:
> Dear All,
>
> I am  estimating a system of equations by nlsur and I am trying to impose demand theory restrictions but I am unable to get what I want. I have 14 equations, but for illustration, I take only three here:
>
> constraint 2 [w1]exp1 + [w2]exp2 + [w3]exp3 = 0
> nlsur(w1=capphi1*({a1}+{lag11}*l1w1+{p11}*lnp1+{p12}*lnp2+{p13}*lnp3+{exp1}*expP +res)+ /// {ph1}*phi1) ///
> (w2=({a2}+{lag22}*l1w2+{p21}*lnp1+{p22}*lnp2+{p23}*lnp3+{exp2}*expP +res)) ///
> (w3=capphi3*({a3}+{lag33}*l1w3+{p31}*lnp1+{p32}*lnp2+{p33}*lnp3+{exp3}*expP +res)+ ///
> {ph3}*phi3), constraints(2)
>
> I am getting this error back:constraints(2) not allowed. I tried to figure out how to solve this but to no avail. I appreciate any advice/help on this.
>

-nlsur- does not accept constraints in the usual Stata sense, but that is not really a limitation.  The constraint

exp1 + exp2 + exp3 = 0

is equivalent to

exp3 = -exp1 - exp2

so instead of having three parameters to estimate, you really only have two.  Instead of referring to {exp3} just refer to (-1*{exp1} - {exp2}) along these lines:

. nlsur (w1 = ... + {exp1}*expP + ... )               ///
(w2 = ... + {exp2}*expP + ... )               ///
(w3 = ... + (-1*{exp1} - {exp2})*expP + ... )

-- Brian Poi
-- brian@poiholdings.com
*
*   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/

*
*   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/
```