For svymean, can't you just pass the subpopulation into the design argument?
> svymean(~crc10yr, design=nhis.design[nhis.design$variables$age>=50,], na.rm=TRUE) crc10yr 0.3461349 attr(,"var") [,1] [1,] 2.903020e-05 > svyglm(crc10yr~I(age>=50)+0, design=nhis.design) Stratified 1 - level Cluster Sampling design With ( 678 ) clusters. Call: svyglm(formula = crc10yr ~ I(age >= 50) + 0, design = nhis.design) Coefficients: I(age >= 50)FALSE I(age >= 50)TRUE 0.1109 0.3461 Degrees of Freedom: 17802 Total (i.e. Null); 17800 Residual Null Deviance: 0.1394 Residual Deviance: 0.09631 AIC: 6.601 -trevor -----Original Message----- From: Thomas Lumley [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 1:17 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [R] Subpopulations in Complex Surveys On Wed, 19 Feb 2003 [EMAIL PROTECTED] 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? > Not directly. This only really matters for svymean. For the regression models it's just a convenience as you can specify a model that has an interaction with the subpopulation indicator to get estimates and standard errors in the subpopulation. For svymean you can use a regression model too: Instead of a hypothetical svymean(~x, design=d, subpop=race==2) do svyglm(x~I(race==2)+0, design=d) I need to work out if there's a general way to handle subpopulations or whether it needs to be coded on a case by case basis. -thomas ______________________________________________ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help ______________________________________________ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help