Description Usage Arguments Details Author(s) See Also Examples
Makes a strat.elec.data
object from an elec.data
object.
1 | makeStratObj(Z, strat.col = NULL, CID = NULL, auditTable = NULL)
|
Z |
An |
strat.col |
Name of column in |
CID |
A vector of length |
auditTable |
A |
makeStratObj
requires as input a valid elec.data
object
Z
such that one of the following is true:
Z
has a vector Z$V$CID
that identifies strata.
A strat.col
name identifying the stratification column in Z$V
is passed to makeStratObj
.
A CID
vector of length nrow(Z$V)
specifying the stratification is passed to makeStratObj
.
If Z$audit
is NULL
, information giving the number
of sampled batches in each stratum can be included through auditTable
.
The argument auditTable
should be a
data.frame
of dimensions unique(CID)
x 2.
The first column is a list of unique stratum IDs.
The second column is the number of batches sampled
within the corresponding stratum.
makeStratObj
creates a data.frame
Z$strat
.
The columns of Z$strat
are
CID
The ID of the stratum.
CIDnum
A number between 1 and length(Z$strat$CID)
assigned to that stratum.
n
The number of batches contained in that stratum.
audit
The number of batches sampled from that stratum.
If no audit data is provided, Z$strat$audit
defaults to a zero vector.
If Z$V$CID
is NULL, makeStratObj
will copy the stratum
labels into Z$V$CID
.
makeStratObj
will also create
Z$CID.col
"CID"
Z$CIDnum
The CIDnum
of the stratum.
Z$V$e.max
maximumMarginBound(Z)
If Z$audit[Z$PID.col]
is not NULL, makeStratObj
will create
Z$audit$e.max
, the maximumMarginBound(Z)
for batches in Z$audit
.
After sending an elec.data
object through makeStratObj
,
the object will be both
an elec.data
object and a strat.elec.data
object.
Mike Higgins, Hua Yang
See strat.elec.data
to create a strat.elec.data
object from a votes data.frame
and an audit data.frame
.
1 2 3 4 | data("CA_House_2008")
dstrat <- CA_House_2008.strat[[1]]
auditTable <- cbind(unique(dstrat$V$CID),1)
dstrat <- makeStratObj(dstrat,auditTable = auditTable)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.