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

# Re: st: nl-command sensitive (sometimes) to unit of measurement

 From "Brian P. Poi" <[email protected]> To [email protected] Subject Re: st: nl-command sensitive (sometimes) to unit of measurement Date Tue, 9 Sep 2008 12:08:46 -0500 (CDT)

```On Tue, 9 Sep 2008, Lina Jonsson wrote:

```
Dear all,

I have encountered a strange phenomenon using the nl-command. I am estimating a model on two subsets. Among the independet variables are two variables that measure a distance and when I changed the unit from meters into km the estimates of other variables in the models changed (by a substantial amount) for one of the subsets but not the other.
```...
```

b1 is 0.56 when the distance variables are measured in meters and 0.48 when measured in km, a quite large difference. Any suggestions how to deal with this?

A couple of thoughts come to mind. First, you might try specifying eps(1e-8) or eps(1e-9) before you fit the model. That controls the convergence criterion. You might find that by tightening that up, the model does in fact converge to the same solution whether you use meters or kilometers.

Second, in linear regression if you multiply a regressor by 1000 then you will get the same parameters, except the parameter for the regressor you multiplied by 1000 will be 1/1000th of its original value. However, that property is not always true for nonlinear models. Here is a trivial example to illustrate that point:

. sysuse auto
. nl (mpg = {b0} + {b1}*exp(1/gear))

mpg | Coef. Std. Err. t P>|t|
--------------------------------------------------
/b0 | 88.36907 10.4828 8.43 0.000
/b1 | -47.71047 7.446863 -6.41 0.000

. replace gear = gear / 10
. nl (mpg = {b0} + {b1}*exp(1/gear))

mpg | Coef. Std. Err. t P>|t|
----------+---------------------------------------
/b0 | 27.02461 1.16402 23.22 0.000
/b1 | -.1680976 .0298792 -5.63 0.000

Thus, the fact that there are 1000 meters in 1 kilometer does not automatically imply that whether you use meters or kilometers will just affect your b1 parameter by a factor of 1000.

Third, you might try using slightly different starting values. Do the starting values you use affect the final results?

-- Brian Poi
-- [email protected]

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