Dale W. Larson
> I am a fairly new Stata user who is trying to do nonlinear
> least squares.
>
> I am using Version 7.
>
> I successfully set up the problem by writing the nlfcn
> program as a do-file.
>
> When I try to run the regression, I get a message such as:
>
> . nl nonlinear averagem1
> __000057 not found
> could not restore sort order because variables were dropped
> r(111);
>
> I don't know what __000057 is. It is not anything I have
> deliberately created.
>
> Each time I rerun the regression, the thing "not found,"
> e.g., __000057 above,
> changes to a different number.
>
> I have not "dropped" any variables from the data set.
Nick Cox
> You are seeing references to temporary variable names.
> The real problem is something wrong with your program
> or with your call to -nl-. I suspect we need to
> see your program code to say more.
Dale sent the code to Statalist (but N.B. no attachments
please on Statalist: see the FAQ!!!)
program define nlnonlinear
version 7.0
use Workfile3
if "`1'"=="?" {
global S_1 "B1 B2"
global B1=.5
global B2=.5
exit
}
replace `1'= (rgdp1^$B1)*(rgdp2^$B2)
end
*End of program. Ready to do nonliner regression.
I was able to get sensible results out of
a relative of this by
1 chopping the "use Workfile3" statement
and doing the equivalent of that in Stata itself
2 putting this program in -nlnonlinear.ado-.
Nick
[email protected]
*
* 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/