svydbboxplot: Boxplot

Description Usage Arguments Author(s) See Also Examples

View source: R/svydbboxplot.R

Description

Boxplot

Usage

1
2
svydbboxplot(x, groups = NULL, design, varwidth = F, outlier = F,
  all.outlier = F)

Arguments

x

Name indicating the variable.

groups

If groups is defined, boxes of x will be split bygroups.

design

svydb.design object.

varwidth

if varwidth = T, the width of the boxes are proportional to the number of observations in that box.

outlier

if outlier = T, observations outside of the 1.5 * IQR will be plotted as points.

all.outlier

if all.outlier = F, Not all the outliers will be plotted. #' @description #' Boxplots for survey data sets.

Author(s)

Charco Hui

See Also

svydbdesign, svydbquantile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(nhane)
nh.dbsurv = svydbdesign(st = SDMVSTRA, wt = WTMEC2YR, id = SDMVPSU, data = nhane)
svydbboxplot(x = Age, groups = Gender, design = nh.dbsurv)
svydbboxplot(x = Age, groups = Race3, design = nh.dbsurv, varwidth = T)
svydbboxplot(x = Height, groups = Race3, design = nh.dbsurv, outlier = T)
svydbboxplot(x = Weight, groups = Gender, design = nh.dbsurv,
     outlier = T, all.outlier = T, varwidth = T)
# OR with a database connection
# library(MonetDBLite)
# library(DBI)
# library(dbplyr)
# con = dbConnect(MonetDBLite())
# dbWriteTable(con, "nhane", nhane)
# nhane.db = tbl(con, "nhane")
# nh.dbsurv = svydbdesign(st = SDMVSTRA, wt = WTMEC2YR, id = SDMVPSU, data = nhane.db)

chrk623/svydb documentation built on Oct. 6, 2019, 6:54 a.m.