svydbrepdesign: Survey replicate design

Description Usage Arguments Author(s) Examples

Description

Gathers all information that are needed to compute survey statistics into a design. Currently, only svydbreptotal, svydbrepmean, are available for replicate statistics.

Usage

1
2
svydbrepdesign(st = NULL, id = NULL, wt = NULL, repwt = NULL,
  scale, 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.

repwt

Regular expressions that matches the columns of the replicate weights.

scale

Scaling constant for variance.

data

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

Author(s)

Charco Hui

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(ss16hde)
hde.dbrepsurv = svydbrepdesign(wt = WGTP, repwt="wgtp[0-9]+", scale = 4/80, data = ss16hde)
hde.dbrepsurv$subset(BATH == 1)
hde.dbrepsurv$clone()
# 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.