Statalist The Stata Listserver


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

Re: st: missing standard error with nonlinear least squares


From   "Rodrigo Alfaro" <[email protected]>
To   <[email protected]>
Subject   Re: st: missing standard error with nonlinear least squares
Date   Thu, 30 Mar 2006 12:56:46 -0500

Dear Giulio,

Following the discussion of Nick, it could be a good idea to run the linear
regression model and deal with the estimation of the parameters with Minimum
Distance Estimation (MDE). The standard error can be computed with the delta
method.

In practice after -reg y x1 x2 x3 x4 x5- you will get 5 coefficients (let's
call them c's) then you have 6 equations c0=b0/(1-b3),..., etc and 6 unknown
b0 to b5. It is a non-linear system that can be solved in any software.

But you can use the information of your model to simply your task in
particular c1=b1 and c2=b2. Note that c4=b3*b2/(1-b3), replacing b2 by c2
you have c4/c2 = b3/(1-b3) assumming that b3 is between 0 and 1 you will get
that b3=(c4/c2)/[1+(c4/c2)], with this value you can solve the rest of the
coefficient.

Rodrigo.
PS: Sorry if you receive this email twice.

----- Original Message ----- From: "n j cox" <[email protected]>
To: <[email protected]>
Sent: Thursday, March 30, 2006 10:22 AM
Subject: Re: st: missing standard error with nonlinear least squares



The principle is easy to illustrate at a much lower level, e.g.

. set obs 1
obs was 0, now 1

. gen y = 42

. su y

Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
y | 1 42 . 42 42

Here, Stata following statistical logic believes that it can
calculate a mean but not a standard deviation. Stata won't
provide a regression for one just one observation, but with
a small tweak it's the same story:

. expand 2
(1 observation created)

. reg y

Source | SS df MS Number of obs = 2
-------------+------------------------------ F( 0, 1) = 0.00
Model | 0 0 . Prob > F = .
Residual | 0 1 0 R-squared = .
-------------+------------------------------ Adj R-squared = .
Total | 0 1 0 Root MSE = 0

------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
_cons | 42 . . . . .
------------------------------------------------------------------------------

This is not estimating a slope, except on unity, but again a minimal example is a small step away:

. gen x = _n

. regress y x

Source | SS df MS Number of obs = 2
-------------+------------------------------ F( 1, 0) = .
Model | 0 1 0 Prob > F = .
Residual | 0 0 . R-squared = .
-------------+------------------------------ Adj R-squared = .
Total | 0 1 0 Root MSE = 0

------------------------------------------------------------------------------
y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
x | 0 . . . . .
_cons | 42 . . . . .
------------------------------------------------------------------------------

Your example is a much more complicated model, but the principle is
a beast of the same kind. The error message is best thought of as a warning, that the data don't provide enough information to assess the model in that respect.

On a different note, I note that the nonlinearity here is entirely
a matter of complicated relationships between the parameters:

Y = b0/(1-b3) + b1*X1 + b2*X2 + [(b3*b1+b4)/(1-b3)]*X3 + [b3*b2/(1-b3)]*X4 + [b5/(1-b3)]*X5 + e

Very crudely, modulo my inability to count,

b0 appears once,
b1 twice,
b2 twice,
b3 six times,
b4 once,
b5 once.

It doesn't seem especially surprising that b3 turns out to be hardest
to determine, as it is so tangled up with most everything else. I can't say more about the topology or geometry of this parameter space, but hands up those who guess it's a mess.

That suggests to me a comparison with a simple regression
on X1 ... X5. No doubt that ignores your substantive or theoretical
grounds for using this parameterisation, but _in practice_ does
it give similar or different predictions for the response?

Giulio Zanella

I estimated a nonlinear model using command nl. Stata produced estimates for
all of the coefficients. However, the standard error of one such coefficient
(and this only) was not computed: a dot replaced the standard error and
related statistics cells. Defining dep var Y coefficients b0 to b5 and
regressors X1 to X5 (plus constant), the model is:

Y = b0/(1-b3) + b1*X1 + b2*X2 + [(b3*b1+b4)/(1-b3)]*X3 + [b3*b2/(1-b3)]*X4 +
[b5/(1-b3)]*X5 + e

I don't understand why Stata can compute the mean of b3 but not its standard
error, while - for instance - standard errors associated with b1 and b2 are produced. Any clue?


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