svyqqplot {survey} | R Documentation |
Quantile-quantile plots for survey data
Description
Quantile-quantile plots either against a specified distribution function or comparing two variables from the same or different designs.
Usage
svyqqplot(formula, design, designx = NULL, na.rm = TRUE, qrule = "hf8",
xlab = NULL, ylab = NULL, ...)
svyqqmath(x, design, null=qnorm, na.rm=TRUE, xlab="Expected",ylab="Observed",...)
Arguments
x , formula |
A one-sided formula for |
design |
Survey design object to look up variables |
designx |
Survey design object to look up the RHS variable in |
null |
Quantile function to compare the data quantiles to |
na.rm |
Remove missing values |
qrule |
How to define quantiles for |
xlab , ylab |
Passed to |
... |
Graphical options to be passed to |
Value
None
See Also
Examples
data(api)
dstrat<-svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat,
fpc=~fpc)
svyqqmath(~api99, design=dstrat)
svyqqplot(api00~api99, design=dstrat)
dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
opar<-par(mfrow=c(1,2))
## sample distributions very different
qqplot(apiclus1$enroll, apistrat$enroll); abline(0,1)
## estimated population distributions much more similar
svyqqplot(enroll~enroll, design=dstrat,designx=dclus1,qrule=survey:::qrule_hf8); abline(0,1)
par(opar)
[Package survey version 4.4-2 Index]