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   Aspen Chen <[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 13:48:13 -0600

Thank you very much for explaining the logic. I was hoping there was a
get-around to make the -glm- command search for link functions within
the mother program that runs it, but I guess I'll just have to settle
for multiple .ado files.

Aspen

----
P. Aspen Chen
Doctoral Candidate
Department of Sociology
University of Connecticut
[email protected]


On Sat, Feb 1, 2014 at 7:08 AM, Maarten Buis <[email protected]> wrote:
> 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/
*
*   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