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: RE: Detect use of svy: prefix


From   Scott Merryman <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Detect use of svy: prefix
Date   Wed, 25 May 2011 12:50:12 -0500

Could you use  - _on_colon_parse- on the command and then check if the
macro s(before) exists and is equal to "svy" ?

For example:

capture _on_colon_parse svy: mean x
sreturn list

Scott


On Wed, May 25, 2011 at 12:49 PM, Richard Williams
<richardwilliams.ndu@gmail.com> wrote:
> At 11:25 AM 5/25/2011, David Radwin wrote:
>>
>> It seems to be the case that e(prefix) will include the value "svy" after
>> running a svy: command. So you could try something like this
>>
>> . if strpos("`e(prefix)'","svy")==0 error
>>
>> adding an error number if you care to.
>
> Thanks David. However, I don't think e(prefix) is ereturned until after your
> program has been run, so I don't think that works.
>
>
*
*   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