[R] Re: Subpopulations in Complex Surveys

Thomas Lumley tlumley at u.washington.edu
Mon Feb 24 18:59:03 CET 2003

On Wed, 19 Feb 2003 TyagiAnupam at aol.com wrote:

> Hi,
> is there a way to analyze subpopulations (e.g. women over 50, those who
> answered "yes" to a particular question) in a survey using Survey package?
> Other packages (e.g. Stata, SUDAAN) do this with a subpopulation option to
> identify the subpopulation for which the analysis shoud be done. I did not
> see this option in the Survey package. Is there another way to do this?

Ok, there is a new version of survey (1.1) that will appear on CRAN over
the next few days that handles subsets as subpopulations in the sense used
by Stata.   There is a function subset.survey.design that makes it easy to
select subsets, eg
    black<-subset(dnhanes, race==1)
but subsets resulting from dropping NAs or from the subset argument to
svyglm or svycoxph are handled the same way.


Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

More information about the R-help mailing list