Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: RE: nl @ within ado

From   Nick Cox <>
To   "''" <>
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. 


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–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index