svyplot {survey}R Documentation

Plots for survey data

Description

Because observations in survey samples may represent very different numbers of units in the population ordinary plots can be misleading. The svyplot function produces plots adjusted in various ways for sampling weights.

Usage

svyplot(formula, design, style = c("bubble", "hex", "grayhex","subsample"),
sample.size = 500, subset = NULL, legend = 1, inches = 0.05, ...)

Arguments

formula A model formula
design A survey object (svydesign or svrepdesign)
style See Details below
sample.size For style="subsample"
subset expression using variables in the design object
legend For style="hex" or "grayhex"
inches Scale for bubble plots
... Passed to plot methods

Details

Bubble plots are scatterplots with circles whose area is proportional to the sampling weight. The two "hex" styles produce hexagonal binning scatterplots, and require the hexbin package from Bioconductor.

The subsample method uses the sampling weights to create a sample from approximately the population distribution and passes this to plot

Bubble plots are suited to small surveys, hexagonal binning and subsampling to large surveys where plotting all the points would result in too much overlap.

Value

None

See Also

Examples

data(api)
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)

svyplot(api00~api99, design=dstrat, style="bubble")
## Not run: 
## these two require the hexbin package from Bioconductor
svyplot(api00~api99, design=dstrat, style="hex", xlab="1999 API",ylab="2000 API")
svyplot(api00~api99, design=dstrat, style="grayhex",legend=0)
## End(Not run)
## Subsampling doesn't really make sense for such a small survey
svyplot(api00~api99, design=dstrat, style="subsample")
svyplot(api00~stype, design=dstrat, style="subsample")


[Package Contents]