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: Re: problem with nlsur quaids
From
Jorge Eduardo Pérez Pérez <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Re: problem with nlsur quaids
Date
Thu, 13 Oct 2011 22:25:51 -0400
As you said, the formulas for the AIDS are the same except for the
parts related to b(p) arising in the derivatives. See the Deaton and
Muellbauer AIDS paper if you have doubts on the formulas.
As for the bug, three potential problems come to my mind: it might be
that you have an extra : somewhere in a -nlcom- call, or a missing _b
(all the calls to b coefficients should read _b[b1], _b[b2] ... or
_b[b`i'] when inside the loop) or that the calls to nlcom are not
finding the estimates previously stored, and that would be why _b[b1]
is not found.
If your problem is among the first two, you have to check the code
again. As for the third potential problem , type -ereturn list- before
running the elasticity calculations and make sure e(b) is listed under
matrices.
Two more comments:
* There is an -qui est restore- line at the end of my code you have to
replace with the name of your stored estimates. That is, after running
your model, store the results using -est store name- where "name" is
the name under which you want to save them. Then, at the end of my
code, your line should read -qui est restore name-
* I fix the a constant on the a(p) index to be 4.7, That is just below
the minimum of the log expenditure for my data, as Deaton and
Muellbauer recommend. You have to change that to fit your data.
_______________________
Jorge Eduardo Pérez Pérez
On Thu, Oct 13, 2011 at 7:08 PM, Nick Cox <[email protected]> wrote:
> You have a bug. This is not enough information for me to have any idea
> what it is.
>
> Experienced coders can spot typos and syntax errors but this sounds
> more like a logic error.
>
> Generically, you debug by using -set trace on- and looking at the
> output. At each stage you need to think through what Stata knows at
> this point. Also, staring at the code only gets you so far. You need
> to look at the data just before the program stops. You need to insert
> statements to print out what Stata has just calculated and so forth.
>
> Nick
>
> On Thu, Oct 13, 2011 at 11:49 PM, minti
> <[email protected]> wrote:
>> Thanks Jorge and Nick. That problem is gone now and I have now an error
>> message sayinng :[b1] not found. Another thing, I have run the equivalent
>> AIDS model (without the elasticities of course). Do I use the same code for
>> elasticities? by removing the terms that are related to bp?
>>
> *
> * 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/