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: Making vce(robust) the default


From   Stas Kolenikov <skolenik@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Making vce(robust) the default
Date   Fri, 5 Aug 2011 20:09:01 -0500

On Thu, Aug 4, 2011 at 2:20 PM, Richard Williams
<richardwilliams.ndu@gmail.com> wrote:
> As for checking for the use of svy:, it can be done now in Stata 12. Suppose
> your program is called myprog.ado. Create another program called
> myprog_svy_check.ado. svy: will check to see if this program exists, and if
> it does it will execute it. For example,
>
> program myprog_svy_check
>         version 12
>         display "svy is being used"
> end
>
> Maybe I can have it set some global parameter so the program knows svy: is
> being used.

That's a freaking dirty programming trick... or undocumented (and
barely supported) implementation detail, depending on how you view
this. It may be usable at the moment, but it may die off with the next
release, or something. I mean, it's better than nothing, but you would
want to program it very defensively, just for the case that something
gets broken down: (1) your global is set by somebody else; (2) -svy-
decides to call another program; (3) some other unpredictable
circumstances that may cause wrong behavior of your program.

I guess the cleanest solution would be for Stata Corp to set a binary
system value like c(svybeingused), so that the third party code does
not get coupled with something in the guts of Stata.

-- 
Stas Kolenikov, also found at http://stas.kolenikov.name
Small print: I use this email account for mailing lists only.

*
*   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