[R] I don't understand the result of `svyboxplot` function from the Survey package

Iulia Dumitru |u||@dmtru @end|ng |rom gm@||@com
Tue Aug 2 11:18:06 CEST 2022


After following the example given here: https://www.rdocumentation.org/packages/survey/versions/4.1-1/topics/svyhist
for `svyboxplot` I get the result in the attached image. This is a box plot of the `enroll` variable from the stratified dataset `apistrat`, grouped by `stype`: E (elementary school), M (middle school) and H (high school). If I use the `svyby` function to group the data by `stype` and find the mean for each group, I get this result:

> svyby(~enroll, ~stype, dstrat, svymean)
  stype  enroll       se
E     E  416.78 16.41740
H     H 1320.70 91.70781
M     M  832.48 54.52157

Clearly the means are very different from each other. Then why don’t the box plots show this? I don’t know how to interpret the plot. Could someone please offer some insight on this? Thank you!




More information about the R-help mailing list