asummary {stratallo}R Documentation

Summarizing the Allocation

Description

[Stable]

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.

Usage

asummary(x, A, m = NULL, M = NULL)

Arguments

x

(numeric)
sample allocations x1,,xHx_1,\ldots,x_H in strata.

A

(numeric)
population constants A1,,AHA_1,\ldots,A_H.

m

(numeric or NULL)
lower bounds m1,,mHm_1,\ldots,m_H, optionally imposed on sample sizes in strata.

M

(numeric or NULL)
upper bounds M1,,MHM_1,\ldots,M_H, optionally imposed on sample sizes in strata.

Value

A data.frame with as many rows as number of strata HH + 1, and up to 7 variables. A single row corresponds to a given stratum h{1,,H}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):

A

population constant AhA_h

m*

lower bound imposed on sample size in stratum

M*

upper bound imposed on sample size in stratum

allocation

sample size for a given stratum

take_min*

indication whether the allocation is of take-min type, i.e. xh=mhx_h = m_h

take_max*

indication whether the allocation is of take-max type, i.e. xh=Mhx_h = M_h

take_Neyman

indication whether the allocation is of take-Neyman type, i.e. mh<xh<Mhm_h < x_h < M_h

See Also

opt(), optcost().

Examples

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)

[Package stratallo version 2.2.1 Index]