All--
Sorry, for "$y $x" read "loglead sizp" in my example, or try:
webuse nhanes2, clear
replace sizp=. if psu==2 & str>10
global y loglead
global x sizp
svydes $y $x, gen(notok)
tab stra notok
egen not=max(notok), by(strat)
g ok=1-not
tab stra ok
qui reg $y $x if !mi(weight,psu,strata)
g new_psu=psu if e(sample)
egen sd_psu=sd(new_psu), by(strata)
qui levelsof strata if sd_psu>0, local(ok)
di "`ok'"
local oklist: subinstr loc ok " " ",", all
di "`oklist'"
g sok=inlist(strata,`oklist')
tab ok sok
svy, subpop(ok): reg $y $x
PS. Brent, you can also
set trace on
set traced 1
to see how locals and globals are evaluated by Stata... a very useful
pair of commands for many purposes, in fact.
*
* 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/