barplot.svystat.RdDraws a barplot or dotplot based on results from a survey analysis. The default
barplot method already works for results from svytable.
Analysis result
Grouped, rather than stacked, bars
Arguments to barplot or dotchart
Overrides the default in dotchart.default
data(api)
dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
a<-svymean(~stype, dclus1)
barplot(a)
barplot(a, names.arg=c("Elementary","High","Middle"), col="purple",
main="Proportions of school level")
b<-svyby(~enroll+api.stu, ~stype, dclus1, svymean)
barplot(b,beside=TRUE,legend=TRUE)
dotchart(b)