Statalist


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

RE: st: RE: re: problem using predictnl after obtaining non-linear estimates


From   Lopa Chakraborti <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: RE: re: problem using predictnl after obtaining non-linear estimates
Date   Sun, 26 Oct 2008 19:51:07 -0400

that's it! I was referring to the coefficient estimates incorrectly by putting the dollar sign in front instead of referring to them as _b[]. It worked.
grateful to all for the feedback and advise
Lopa
________________________________________
From: [email protected] [[email protected]] On Behalf Of Maarten buis [[email protected]]
Sent: Sunday, October 26, 2008 4:54 PM
To: [email protected]
Subject: Re: st: RE: re: problem using predictnl after obtaining non-linear estimates

--- Lopa Chakraborti <[email protected]> wrote:
> I tried using nlcom without using any of the Xs and it seems to
> generate only a constant. It seems that only the point estimates of
> the parameters are being used and not the variance covariance matrix.
> nlcom (bod1 : ($K2/($K1-$K2))*exp(-$K1)*(exp(-$K2)-exp(-$K1)))
>
>         bod1:
>
(.0014539294546791/(.0009593881362685-.0014539294546791))*exp(-.0009593881
> > 362685)*(exp(-.0014539294546791)-exp(-.0009593881362685))

While it is legal syntax to use global or local macros, and apparently
-nl- stores the coefficients in the global macro you have used, these
macros just contain the numbers without any reference to the model or
the variance covariance matrix. If you want to combine parameter
estimates you will have to refer to the parameters as:
[equation name]_b[variable name]. -nl- can be a bit weird in how it
stores the coefficients, and I would not be surprised if that has
changed since Stata 8. The easiest way to find out how to refer to the
parameters is to type -matrix list e(b)-

If you get something like:

e(b)[1,2]
           mpg       _cons
y1  -238.89435   11253.061

you can refer to the parameters as _b[mpg] and _b[_cons]

If you get something like:

e(b)[1,4]
             4:          4:          5:          5:
         price       _cons       price       _cons
y1   -.0000205  -.67229653   -.0000414  -1.0395561

You can refer to them as [4]_b[price] and [5]_b[price]

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room N515

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------



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



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index