Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

Re: st: RE: Detect use of svy: prefix

From   Richard Williams <>
Subject   Re: st: RE: Detect use of svy: prefix
Date   Wed, 25 May 2011 16:28:31 -0500

At 12:50 PM 5/25/2011, Scott Merryman wrote:
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


Thanks Scott. I tried adding

capture _on_colon_parse: `0'

but the s(before) isn't showing up. But, I do see

              s(after) : " health female if __000001 [iw=__000002] ,    "

That suggests one possible workaround: svy calls a program using iweights, and you can check to see if iweights are being used. The one problem would be if somebody actually did want to use iweights without using svy.

There are various ways to tell if the -by- prefix has been used, e.g. function _by() . I wish there was something comparable for svy.

Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index