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


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

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.


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


Giulio Zanella

* For searches and help try:

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

Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail
* For searches and help try:
*   For searches and help try:

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