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

st: subpop() option of svy commands

From   "Sergiy Radyakin" <>
To   "" <>
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

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


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:

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