Bookmark and Share

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]

Re: st: Running glm with user-written link function in a program without a separate ado file?


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: Running glm with user-written link function in a program without a separate ado file?
Date   Sat, 1 Feb 2014 14:08:46 +0100

On Fri, Jan 31, 2014 at 4:12 PM, Aspen Chen wrote:
> I have been writing a program (an ado file) that runs a glm estimate
> with a user-written link function. The program can run successfully
> when the link function is stored as a separate ado file. But I would
> like to keep the entire program as one single ado file for simplicity
> sake if possible. Does someone know if there is a way to accomplish
> it?

You cannot do that. The logic behind this is that the programs defined
after the first program in an.ado file are local to the programs
defined in that .ado file. So only programs in that .ado file can see
that program. However, the -glm- program needs to be able to see that
program in order to use it. So your user written link function needs
to be in its own .ado file.

Hope this helps,
Maarten

---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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