Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: question on svymean for subpopulation


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: question on svymean for subpopulation
Date   Mon, 6 Dec 2004 13:35:18 -0500

In general, you should not use -if- to select cases when working with survey data (more specifically with svy commands). Instead, you should use either a -by- option when offered or else use -subpop()-. svy commands correctly use information about the entire sample design even when calculating estimates for a subpopulation if you use the subpop option. When you use -if-, then the svy command essentially ignores the sampling info for everything excluded and will usually give you results you don't want -- and often lead to the dreaded singleton psu problem. There are some exceptions when -if- will work fine, but it is best to just avoid the -if- option in most cases when working with svy data. You should read the manual for a better understanding.

Michael Blasnik
[email protected]

----- Original Message ----- From: "Chenghui Li" <[email protected]>
To: <[email protected]>
Sent: Monday, December 06, 2004 12:34 PM
Subject: st: question on svymean for subpopulation



Hi,

Could anyone please help me understand the difference between
svymean age, by(female)
and
svymean age  if female=1?

If I use the second command, I sometimes will get the error message about
only one psu. I never have such a problem with the first command. How the
psus and strata are handled using the by() option? And how it is different
from using "if" command? My goal is to estimate average age by gender.
Does the first command assume eaqual size of male and female? Intuitively,
I would use the second one, or think these 2 are the same. I don't
understand why they are different.

THanks in advance for your help.

Chenghui Li

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