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 at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Dropping Program Saved as an ado-file


From   Maarten Buis <maartenlbuis@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Dropping Program Saved as an ado-file
Date   Wed, 5 Sep 2012 17:00:29 +0200

On Wed, Sep 5, 2012 at 2:56 PM, Nick Cox wrote:
> An alternative is to pass the names of temporary variables via an
> option. If you have
>
> tempvar foobar
> gen `foobar' = ...
>
> you can call a subprogram with
>
> ... foobar(`foobar')
>
> This requires care, but so does sharing names via a global. For
> example, that global will stick around with inbuilt potential to mess
> up other things if you are not careful.

Absolutely, and for the example program I gave earlier, that is
probably the way I would go too. However, I suspected that in the
original question Christoph wanted to pass these temporary variables
on to a likelihood evaluator program, and I don't see a
straightforward way to implement this "option-strategy" within -ml-.

-- 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/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index