svydbreptotal: Population Total with replicate weights

Description Usage Arguments Author(s) See Also Examples

View source: R/svydbreptotal.R

Description

Computes population total from survey data sets with replicate weights.

Usage

1
svydbreptotal(x, design, num, return.replicates = F)

Arguments

x

Name indicating the variable.

design

svydb.repdesign object.

num

TRUE or FALSE indicating whether x is numeric or categorical.

return.replicates

TRUE to return the totals computed with replicate weights.

Author(s)

Charco Hui

See Also

svydbrepdesign, svydbreptotal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(ss16hde)
hde.dbrepsurv = svydbrepdesign(wt = WGTP, repwt="wgtp[0-9]+", scale = 4/80, data = ss16hde)
svydbreptotal(x = BATH, design = hde.dbrepsurv, num = T)
svydbreptotal(x = FS, design = hde.dbrepsurv, num = F)
svydbreptotal(x = HHT, design = hde.dbrepsurv, num = T, return.replicates = T)$replicates
coef(svydbreptotal(x = BATH, design = hde.dbrepsurv, num = T))
SE(svydbreptotal(x = BATH, design = hde.dbrepsurv, num = T))
# OR with a database connection
# library(MonetDBLite)
# library(DBI)
# library(dbplyr)
# con = dbConnect(MonetDBLite())
# dbWriteTable(con, "ss16hde", ss16hde)
# ss16hde.db = tbl(con, "ss16hde")
# hde.dbrepsurv = svydbrepdesign(wt = WGTP, repwt="wgtp[0-9]+", scale = 4/80, data = ss16hde.db)

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