Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: imposing cross-equation constrains with nlsur


From   "Brian P. Poi" <brian@poiholdings.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: imposing cross-equation constrains with nlsur
Date   Tue, 07 Jun 2011 20:19:51 -0400


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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index