Bookmark and Share

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]

st: nlsur quaids result depends on previous command


From   "Johannes Kutsam" <[email protected]>
To   <[email protected]>
Subject   st: nlsur quaids result depends on previous command
Date   Sat, 9 Jul 2011 08:09:32 +0200

Dear all,
(and especially Brian Poi),

I am estimating a QUAIDS demand system with nlsur quaids (POI 2008)
(http://www.stata-journal.com/article.html?article=st0029_1 )

I think found an error in either nlsur or quaids:  
The coefficients are dependent on the command called before.

It can be reproduced using the example in sj8-4

webuse food
nlsur quaids @ w1 w2 w3 lnp1-lnp4 lnexp,ifgnls nequations(3) param(a1 a2 a3
b1 b2 b3 g11 g12 g13 g22 g23 g33 l1 l2 l3) nolog
nlsur quaids @ w1 w2 w3 lnp1-lnp4 lnexp,ifgnls nequations(1) param(a1 a2 a3
b1 b2 b3 g11 g12 g13 g22 g23 g33 l1 l2 l3) nolog
nlsur quaids @ w1 w2 w3 lnp1-lnp4 lnexp,ifgnls nequations(3) param(a1 a2 a3
b1 b2 b3 g11 g12 g13 g22 g23 g33 l1 l2 l3) nolog

Note that the 3 line with "nequations(1)" is of course wrong - because we
have 3 equations. BUT once this line was executed 
The correct command  with "nequations(3) will yield wrong coefficients. (I
am not saying one should run wrongly specified systems...but it happens when
developing)

 I suspect that some variables are not initialized correctly in quaids that
could cause this problem.

When I clear the dataset and load it again I again get the same coefficents
as reported in sj8-4. So there is something temporarily saved by the call to
nlsur quaids that confuses
a subsequent call.

Johannes Kutsam
[email protected]


Example output:


. webuse food

. nlsur quaids @ w1 w2 w3 lnp1-lnp4 lnexp,ifgnls nequations(3) param(a1 a2
a3 b1
>  b2 b3 g11 g12 g13 g22 g23 g33 l1 l2 l3) nolog

----------------------------------------------------------------------------
--
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
         /a1 |   .3136617    .008671    36.17   0.000     .2966669
.3306565
         /a2 |   .2712567   .0067025    40.47   0.000     .2581201
.2843933
         /a3 |   .1052015   .0034241    30.72   0.000     .0984903
.1119126


. nlsur quaids @ w1 w2 w3 lnp1-lnp4 lnexp,ifgnls nequations(1) param(a1 a2
a3 b1
>  b2 b3 g11 g12 g13 g22 g23 g33 l1 l2 l3) nolog

----------------------------------------------------------------------------
--
          w1 |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
         /a1 |   .3368911   .0088494    38.07   0.000     .3195465
.3542357
         /a2 |  -3.929404          .        .       .            .
.
         /a3 |  -6.150973          .        .       .            .
.


nlsur quaids @ w1 w2 w3 lnp1-lnp4 lnexp,ifgnls nequations(3) param(a1 a2 a3
b1
>  b2 b3 g11 g12 g13 g22 g23 g33 l1 l2 l3) nolog


             |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
Interval]
-------------+--------------------------------------------------------------
--
         /a1 |   .3368911   1.61e-08  2.1e+07   0.000     .3368911
.3368911
         /a2 |  -3.929404   1.83e-08 -2.1e+08   0.000    -3.929404
-3.929404
         /a3 |  -6.150973   1.58e-08 -3.9e+08   0.000    -6.150973
-6.150973
         /b1 |   .0223044          .        .       .            .
.



*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index