survey (version 1.9-2)

subset.survey.design: Subset of survey

Description

Restrict a survey design to a subpopulation, keeping the original design information about number of clusters, strata.

Usage

## S3 method for class 'survey.design':
subset(x, subset, ...)

Arguments

x
A survey.design object
subset
An expression specifying the subpopulation
...
Arguments not used by this method

Value

  • A survey.design object

See Also

svydesign

Examples

Run this code
data(fpc)
dfpc<-svydesign(id=~psuid,strat=~stratid,weight=~weight,data=fpc,nest=TRUE)
dsub<-subset(dfpc,x>4)
summary(dsub)
## These should give the same estimates and variances
svymean(~x,dsub)
svyglm(x~I(x>4)+0,design=dfpc)

Run the code above in your browser using DataLab