asummary | R Documentation |
A helper function that returns a simple data.frame
with summary of the
allocation as returned by the opt()
or optcost()
. See the illustrate
example below.
asummary(x, A, m = NULL, M = NULL)
x |
( |
A |
( |
m |
( |
M |
( |
A data.frame
with as many rows as number of strata H
+ 1,
and up to 7 variables. A single row corresponds to a given stratum
h \in \{1,\ldots,H\}
, whilst the last row contains sums of all of the
numerical values from the above rows (wherever feasible).
Summary table has the following columns (* indicates that the column may
not be present):
population constant A_h
lower bound imposed on sample size in stratum
upper bound imposed on sample size in stratum
sample size for a given stratum
indication whether the allocation is of take-min
type,
i.e. x_h = m_h
indication whether the allocation is of take-max
type,
i.e. x_h = M_h
indication whether the allocation is of take-Neyman
type, i.e. m_h < x_h < M_h
opt()
, optcost()
.
A <- c(3000, 4000, 5000, 2000)
m <- c(100, 90, 70, 80)
M <- c(200, 150, 300, 210)
xopt_1 <- opt(n = 400, A, m)
asummary(xopt_1, A, m)
xopt_2 <- opt(n = 540, A, m, M)
asummary(xopt_2, A, m, M)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.