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]

st: RE: Detect use of svy: prefix


From   "David Radwin" <[email protected]>
To   <[email protected]>
Subject   st: RE: Detect use of svy: prefix
Date   Wed, 25 May 2011 09:25:15 -0700 (PDT)

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.

David
--
David Radwin
Research Associate
MPR Associates, Inc.
2150 Shattuck Ave., Suite 800
Berkeley, CA 94704
Phone: 510-849-4942
Fax: 510-849-0794

www.mprinc.com


> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Richard Williams
> Sent: Wednesday, May 25, 2011 9:52 AM
> To: [email protected]
> Subject: st: Detect use of svy: prefix
> 
> Is there any way to tell if the svy: prefix has been used when
> calling a command? I have a quirky program where some options work
> fine with svy: but others don't, so I'd like to be able to issue an
> error message in the problematic situations.
> 
> -------------------------------------------
> Richard Williams, Notre Dame Dept of Sociology
> OFFICE: (574)631-6668, (574)631-6463
> HOME:   (574)289-5227
> EMAIL:  [email protected]
> WWW:    http://www.nd.edu/~rwilliam
> 
> *
> *   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/
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index