Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

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

# st: nlcom and scalar give different results with same espression

 From Luca Fumarco To "statalist@hsphsun2.harvard.edu" Subject st: nlcom and scalar give different results with same espression Date Wed, 9 May 2012 22:03:46 +0200

```Dear Statalister,

During some computation with the nlcom command, I come across the message "Maximum number of iterations exceeded", this is not a new thing for you statalisters (http://www.stata.com/statalist/archive/2009-03/msg01244.html).
As suggested in that past thread, I multiply my value by a large number and then I recover it in a next step.
However, when I double check the result by computing the same value with "scalar", the result is different.

This is what I write:

NLCOM version ->

nlcom (UNOBVARfirst: (1e+2)*normal((_b[_cons]+1*_b[Immig]+_b[experiment]*MeanEx)/exp(_b[lnsigma2:Immig]*1))-normal((_b[_cons]+0*_b[Immig]+_b[experiment]*MeanEx)/exp(_b[lnsigma2:Immig]*0))-predsndy*(_b[Immig]/exp(_b[lnsigma2:Immig]*1))), post

nlcom UNOBVAR: _b[UNOBVARfirst]/(1e+2)

****UNOBVAR= 0.1236019

SCALAR version ->

scalar UNOBVARcheck=normal((_b[_cons]+1*_b[Immig]+_b[experiment]*MeanEx)/exp(_b[lnsigma2:Immig]*1))-normal((_b[_cons]+0*_b[Immig]+_b[experiment]*MeanEx)/exp(_b[lnsigma2:Immig]*0))-predsndy*(_b[Immig]/exp(_b[lnsigma2:Immig]*1))

****UNOBVARcheck=-0.06785729

It occurs to me also in a couple of other instances.

Any idea?
Thank you for you time

Luca Fumarco
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index