Description Usage Arguments Author(s) See Also Examples
Survey statistics on subsets, currently only works on svydbtotal
,
svydbmean
.
1 |
x |
A variable specifying the variable to pass to FUN. |
by |
A variable specifying factors that define the subsets. |
FUN |
A function indicating the desired survey statistics. |
design |
|
... |
Other arguments to pass to FUN. |
Charco Hui
svydbdesign
, svydbtotal
, svydbmean
1 2 3 4 5 6 7 8 9 10 11 12 | data(nhane)
nh.dbsurv = svydbdesign(st = SDMVSTRA, wt = WTMEC2YR, id = SDMVPSU, data = nhane)
svydbby(x = Age, by = Gender, FUN = svydbmean, design = nh.dbsurv, num = T)
svydbby(x = BMI, by = Race3, FUN = svydbtotal, design = nh.dbsurv, num = 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.