Bookmark and Share

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

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

st: RE: nl @ within ado

From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: nl @ within ado
Date   Mon, 25 Oct 2010 13:15:47 +0100

Conversely, why it is a problem that a separate file is needed? For example, packages based on -ml- are distributed as sets of files. 

[email protected] 

Keith Dear

I am trying to build an ado file to fit a certain nonlinear model using
the function evaluator version of nl.
This requires defining a subsidiary program whose name must begin with
'nl'. So I wrote something like this:

======== mymodel.ado
prog mymodel
nl myfit @ y x, param(...) init(...)

prog nlmyfit

This doesn't work because, being a subprogram of mymodel, the program
nlmyfit is actually named mymodel.nlmyfit, and so nl doesn't find it. If
I move the definition of nlmyfit to the calling do-file then the whole
thing works, but that defeats the purpose of writing an ado file at all.

Is there a way to define a program within an ado file but NOT have it
named as a subprogram?
(I tried putting nlmyfit in a separate file and running it from within
mymodel.ado, but Stata wasn't fooled.)
Or any other solution?

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index