svydbdesign: Survey design

Description Usage Arguments Author(s) See Also Examples

Description

Gathers all information that are needed to compute survey statistics into a design.

Usage

1
svydbdesign(st = NULL, id = NULL, wt = NULL, data)

Arguments

st

Column name specifying the strata column. NULL for no strata.

id

Column name specifying the cluster column. NULL for no cluster.

wt

Column name specifying the sampling weights column.

data

A data frame or sql table of the survey data set..

Author(s)

Charco Hui

See Also

svydbtotal, svydbmean

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(nhane)
nh.dbsurv = svydbdesign(st = SDMVSTRA, wt = WTMEC2YR, id = SDMVPSU, data = nhane)
nh.dbsurv$subset(Race3 == 3)
nh.dbsurv$getmh()
nh.dbsurv$getwt()
nh.dbsurv$clone()
# OR with a database connection
# library(MonetDBLite)
# library(DBI)
# library(dbplyr)
# con = dbConnect(MonetDBLite())
# dbWriteTable(con, "nhane", nhane)
# nhane.db = tbl(con, "nhane")

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