Statalist The Stata Listserver


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

Re: st: programming: automate identification of strata with one psu


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: programming: automate identification of strata with one psu
Date   Sun, 17 Dec 2006 05:23:32 -0500

Brent--

Ignoring more "statistical" solutions such as multiple imputation or
estimating conservative SEs by ignoring strata, suppose you quietly
regress without -svy- then calculate n of PSUs per stratum if
e(sample) then issue a -levelsof- strata if the n exceeds 1, e.g.

qui reg y $x if !mi(weight,psu,strata)
g u_psu=1 if e(sample)
egen n_psu=count(u_psu), by(strata)
levelsof strata if n_psu>1, local(ok)
local oklist: subinstr loc ok " " ",", all
drop n_psu u_psu
svy, subpop(inlist(strata,`oklist')): reg y $x

Does that work?

On 12/16/06, Brent Fulton <[email protected]> wrote:
I am using Stata 9.2 and am running -svy: reg y x1 x2- using a svyset with
pweights, strata id, and psu id. Stata will not estimate standard errors if
a stratum has a single psu.
And Stata estimates the standard errors.

Is there a way to make this process dynamic. For example, when I change the
regression to:

svy: reg y x1 x2 x3

then missing values in x3 may cause another stratum to have one psu. I'd
like to be able to run -svydes y x1 x2 x3-, put the results into a matrix,
and search for strata with one psu, and identify the strata using a macro.

svy: subpop(!inlist(strata_id, $macro_of_strata_with_one_psu)): reg y x1 x2
x3

However, -return list- and -ereturn list- are empty after running -svydes y
x1 x2 x3-. Does anyone have any suggestions?

Lastly, is there another way to estimate the standard errors using Stata (or
using another statistical program e.g., SUDAAN; or bootstrap) when a
stratrum has a single psu.

Thanks,
Brent

___________________________________
Brent D. Fulton, PhD
Health Services Researcher
Petris Center at UC Berkeley
Phone: 510-643-4102
Fax: 510-643-4281
Email: [email protected]
www.petris.org

*
*   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/

*
*   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