Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: subpop() option of svy commands


From   "Sergiy Radyakin" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: subpop() option of svy commands
Date   Wed, 9 Jul 2008 12:14:45 -0400

Dear All,

is this a correct behaviour?

sysuse auto
svyset [w=weight]
svy: mean price, subpop(if !missing(rep78))

(running mean on estimation sample)
missing() may not be nested within missing()
invalid syntax
r(198);

The help for svy: refers to standard if() description and does not
mention any particular restrictions on the expression specified in
subpop().

Workaround:

tempvar interesting
gen `interesting'=!missing(rep78)
svy: mean price , subpop(if `interesting')

Could that be incorporated into _svy_subpop routine? Currently it fails here:


- quietly replace `subuse' = . if missing(`exp')
= quietly replace __00000T = . if missing(!missing(rep78))
}
markout `touse' `subvar' `subuse'
if "`subvar'" != "" {
   quietly replace `subuse' = 0 if `subvar' == 0
}
}

Also, what is the nature of the restriction that missing() does not
allow missing() inside it? Say, I want to check "if
missing(X/missing(Z))" . I know I can always regroup it so that there
is only one missing() is used, but I don't see the point.

Thank you,
   Sergiy Radyakin
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index