Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: storing coefficients generated by nlcom


From   Giulio Zanella <[email protected]>
To   [email protected]
Subject   Re: st: storing coefficients generated by nlcom
Date   Fri, 24 Mar 2006 10:15:42 +0100

My problem is the following:

(1) Use nlcom to compute a nonlinear function of coefficients, say the "or" function in the example below.
(2) Use nlcom again to compute a nonlinear function of coefficients *involving the previously computed function*. For this Stata needs to use both coefficient and standard error of the previously computed function. These are stored in r(b) and r(V), but is there an easy way to use them in the nlcom command like we did with _b[mpg] below?

This problem arises when recovering structural form parameters from reduced form estimates. An alternative is to use nonlinear least squares command nl. Do you think this is preferable?

Many thanks

Giulio


----- Original Message ----- From: "Maarten buis" <[email protected]>
To: <[email protected]>
Sent: Thursday, March 23, 2006 8:20 PM
Subject: Re: st: storing coefficients generated by nlcom



Giulio:
In most cases I would not append it to the e(b) matrix since than the e(b) and e(V) (Variance
Covariance matrix) no longer match. If it is a matter of storing coefficients in one matrix you
could make a new matrix (call it b) and append the e(b) vector with the r(b) vector like in the
example below. You could also have a look at Roger Newson's -parmest- which might help store the
estimates in a seperate dataset. This can be helpful if you want to graph them. This is the all
the advice I can give you, since you don't tell us what you want to do with the estimates.

HTH,
Maarten

*------------begin example--------------
sysuse auto, clear
logit foreign mpg
nlcom or: exp(_b[mpg])
matrix b = e(b),r(b)
matrix list b
*-------------end example-----------------


--- Giulio Zanella <[email protected]> wrote:

After estimation, I generated a nonlinear combination of a coefficient (and
standard error) with command nlcom. This coefficient is stored into matrix
s(b). Is there a way to add this new coefficient to the e(b) matrix of
original coeffients? Command nlcom allows option post, which replaces the
e(b) matrix instead of updating it.

Thanks

Giulio Zanella

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/


-----------------------------------------
between 1/2/2006 and 31/3/2006 I will be
visiting the UCLA, during this time the
best way to reach me is by email

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

visiting adress:
Buitenveldertselaan 3 (Metropolitan), room Z214

+31 20 5986715

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





___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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